Skip to content

Commit

Permalink
Merge pull request #14 from zuoyebang/dev
Browse files Browse the repository at this point in the history
modify readme
  • Loading branch information
xingfu89 authored Jun 4, 2024
2 parents 925681b + 95b139c commit 535e59b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 140 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/goccy/go-json v0.10.2
github.com/golang/snappy v0.0.4
github.com/gomodule/redigo v2.0.0+incompatible
github.com/google/gops v0.3.28
github.com/hashicorp/memberlist v0.2.4
github.com/json-iterator/go v1.1.12
github.com/juju/ratelimit v1.0.2-0.20191002062651-f60b32039441
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gops v0.3.28 h1:2Xr57tqKAmQYRAfG12E+yLcoa2Y42UJo2lOrUFL9ark=
github.com/google/gops v0.3.28/go.mod h1:6f6+Nl8LcHrzJwi8+p0ii+vmBFSlB4f8cOOkTJ7sk4c=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/context v1.1.2 h1:WRkNAv2uoa03QNIc1A6u4O7DAGMUVoopZhkiXWA2V1o=
Expand Down
2 changes: 0 additions & 2 deletions stored/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/zuoyebang/bitalostored/stored/internal/tclock"
"github.com/zuoyebang/bitalostored/stored/plugin/anticc"
"github.com/zuoyebang/bitalostored/stored/plugin/catch_panic"
"github.com/zuoyebang/bitalostored/stored/plugin/gops"
"github.com/zuoyebang/bitalostored/stored/plugin/info"
"github.com/zuoyebang/bitalostored/stored/plugin/pprof"
"github.com/zuoyebang/bitalostored/stored/plugin/raft"
Expand Down Expand Up @@ -71,7 +70,6 @@ func main() {
info.Init()
catch_panic.Init()
pprof.Init()
gops.Init()
raft.Init()
anticc.Init()

Expand Down
39 changes: 0 additions & 39 deletions stored/plugin/gops/gops.go

This file was deleted.

15 changes: 15 additions & 0 deletions stored/server/cmd_global.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
package server

import (
"os"
"runtime/debug"
"syscall"

"github.com/zuoyebang/bitalostored/stored/internal/errn"
"github.com/zuoyebang/bitalostored/stored/internal/resp"
"github.com/zuoyebang/bitalostored/stored/internal/utils"
)
Expand All @@ -30,9 +33,21 @@ func init() {
"debuginfo": {Sync: false, Handler: debugInfoCommand, NoKey: true},
"cacheinfo": {Sync: false, Handler: cacheInfoCommand, NoKey: true},
"freememory": {Sync: false, Handler: freeOsMemoryCommand, NoKey: true},
"shutdown": {Sync: false, Handler: shutdownCommand, NoKey: true},
})
}

func shutdownCommand(c *Client) error {
c.conn.Close()

p, _ := os.FindProcess(os.Getpid())

p.Signal(syscall.SIGTERM)
p.Signal(os.Interrupt)

return errn.ErrClientQuit
}

func freeOsMemoryCommand(c *Client) error {
debug.FreeOSMemory()
c.RespWriter.WriteStatus(resp.ReplyOK)
Expand Down
58 changes: 0 additions & 58 deletions stored/server/db.go

This file was deleted.

38 changes: 0 additions & 38 deletions stored/server/ops.go

This file was deleted.

0 comments on commit 535e59b

Please sign in to comment.