优化升级依赖包

This commit is contained in:
gotoeasy 2022-12-18 18:32:54 +08:00
parent 9e66e3591d
commit e99668cd17
7 changed files with 7 additions and 37 deletions

View File

@ -3,7 +3,7 @@ module glc
go 1.19
require (
github.com/gotoeasy/glang v0.0.0-20221129060837-2dac80459439
github.com/gotoeasy/glang v0.0.0-20221215063310-d39cd67685c4
github.com/syndtr/goleveldb v1.0.0
)

View File

@ -59,8 +59,8 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gotoeasy/glang v0.0.0-20221129060837-2dac80459439 h1:j/0otTGRqCzAX0IVApJ9ze0n18eWvk+1o+sme8rPs5s=
github.com/gotoeasy/glang v0.0.0-20221129060837-2dac80459439/go.mod h1:pPAtzrhD9tyAPUCaEhC5p+1J6V+opnPEBVMbiMIBrqA=
github.com/gotoeasy/glang v0.0.0-20221215063310-d39cd67685c4 h1:oPNNL1xjus3RvIln/n3mWG2raL+NciiQRD1+dyZZ0oE=
github.com/gotoeasy/glang v0.0.0-20221215063310-d39cd67685c4/go.mod h1:zRo6xc3N5z/VsPCKHlmEz/Uz9XyiQbV3IAv3xsSTPV8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huichen/sego v0.0.0-20210824061530-c87651ea5c76 h1:qNQ2+1IQT9Mor/vfEHePOQSbiapLoNI7sQmpxM7l1Ew=
github.com/huichen/sego v0.0.0-20210824061530-c87651ea5c76/go.mod h1:Fymg8+khR/cKSuIwqRxy/jmZg7PIPLk7CauXzrbcMUM=

View File

@ -6,7 +6,6 @@ import (
"glc/conf"
"glc/ldb"
"glc/ldb/storage/logdata"
"glc/onexit"
"net/http"
"regexp"
"time"
@ -110,7 +109,7 @@ func Run() {
}
// 优雅退出
onexit.RegisterExitHandle(func() {
cmn.OnExit(func() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
cmn.Info("退出Web服务")

View File

@ -3,7 +3,6 @@ package backup
import (
"glc/com"
"glc/conf"
"glc/onexit"
"math"
"path/filepath"
"time"
@ -17,7 +16,7 @@ func init() {
if !conf.IsEnableBackup() {
return
}
onexit.RegisterExitHandle(onExit)
cmn.OnExit(onExit)
}
func Start() {

View File

@ -13,7 +13,6 @@ import (
"glc/ldb/storage/indexword"
"glc/ldb/sysmnt"
"glc/ldb/tokenizer"
"glc/onexit"
"sync"
"time"
@ -43,7 +42,7 @@ var mapStorage map[string](*LogDataStorage)
func init() {
mapStorage = make(map[string](*LogDataStorage))
onexit.RegisterExitHandle(onExit) // 优雅退出
cmn.OnExit(onExit) // 优雅退出
}
func getCacheStore(cacheName string) *LogDataStorage {

View File

@ -1,27 +0,0 @@
package onexit
import (
"os"
"os/signal"
"syscall"
"github.com/gotoeasy/glang/cmn"
)
var fnExits []func()
func init() {
go func() {
osc := make(chan os.Signal, 1)
signal.Notify(osc, syscall.SIGTERM, syscall.SIGINT)
<-osc
cmn.Info("收到退出信号准备退出")
for _, fnExit := range fnExits {
fnExit()
}
}()
}
func RegisterExitHandle(fnExit func()) {
fnExits = append(fnExits, fnExit)
}

View File

@ -1,3 +1,3 @@
package onstart
const VERSION = "glogcenter 0.8.3"
const VERSION = "glogcenter 0.8.4"