mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
优化升级依赖包
This commit is contained in:
parent
9e66e3591d
commit
e99668cd17
@ -3,7 +3,7 @@ module glc
|
|||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
require (
|
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
|
github.com/syndtr/goleveldb v1.0.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -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/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 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
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-20221215063310-d39cd67685c4 h1:oPNNL1xjus3RvIln/n3mWG2raL+NciiQRD1+dyZZ0oE=
|
||||||
github.com/gotoeasy/glang v0.0.0-20221129060837-2dac80459439/go.mod h1:pPAtzrhD9tyAPUCaEhC5p+1J6V+opnPEBVMbiMIBrqA=
|
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/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 h1:qNQ2+1IQT9Mor/vfEHePOQSbiapLoNI7sQmpxM7l1Ew=
|
||||||
github.com/huichen/sego v0.0.0-20210824061530-c87651ea5c76/go.mod h1:Fymg8+khR/cKSuIwqRxy/jmZg7PIPLk7CauXzrbcMUM=
|
github.com/huichen/sego v0.0.0-20210824061530-c87651ea5c76/go.mod h1:Fymg8+khR/cKSuIwqRxy/jmZg7PIPLk7CauXzrbcMUM=
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import (
|
|||||||
"glc/conf"
|
"glc/conf"
|
||||||
"glc/ldb"
|
"glc/ldb"
|
||||||
"glc/ldb/storage/logdata"
|
"glc/ldb/storage/logdata"
|
||||||
"glc/onexit"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
"time"
|
"time"
|
||||||
@ -110,7 +109,7 @@ func Run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 优雅退出
|
// 优雅退出
|
||||||
onexit.RegisterExitHandle(func() {
|
cmn.OnExit(func() {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
cmn.Info("退出Web服务")
|
cmn.Info("退出Web服务")
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package backup
|
|||||||
import (
|
import (
|
||||||
"glc/com"
|
"glc/com"
|
||||||
"glc/conf"
|
"glc/conf"
|
||||||
"glc/onexit"
|
|
||||||
"math"
|
"math"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
@ -17,7 +16,7 @@ func init() {
|
|||||||
if !conf.IsEnableBackup() {
|
if !conf.IsEnableBackup() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
onexit.RegisterExitHandle(onExit)
|
cmn.OnExit(onExit)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Start() {
|
func Start() {
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import (
|
|||||||
"glc/ldb/storage/indexword"
|
"glc/ldb/storage/indexword"
|
||||||
"glc/ldb/sysmnt"
|
"glc/ldb/sysmnt"
|
||||||
"glc/ldb/tokenizer"
|
"glc/ldb/tokenizer"
|
||||||
"glc/onexit"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ var mapStorage map[string](*LogDataStorage)
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
mapStorage = make(map[string](*LogDataStorage))
|
mapStorage = make(map[string](*LogDataStorage))
|
||||||
onexit.RegisterExitHandle(onExit) // 优雅退出
|
cmn.OnExit(onExit) // 优雅退出
|
||||||
}
|
}
|
||||||
|
|
||||||
func getCacheStore(cacheName string) *LogDataStorage {
|
func getCacheStore(cacheName string) *LogDataStorage {
|
||||||
|
|||||||
@ -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)
|
|
||||||
}
|
|
||||||
@ -1,3 +1,3 @@
|
|||||||
package onstart
|
package onstart
|
||||||
|
|
||||||
const VERSION = "glogcenter 0.8.3"
|
const VERSION = "glogcenter 0.8.4"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user