Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

应对gcache接口变化 #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import (
"time"

"github.com/glycerine/rbuf"
"github.com/qiniu/log"

log "github.com/sirupsen/logrus"
)

// The new broadcast
Expand Down
7 changes: 4 additions & 3 deletions distributed.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import (
"github.com/bluele/gcache"
"github.com/gorilla/mux"
"github.com/gorilla/websocket"
"github.com/qiniu/log"

log "github.com/sirupsen/logrus"
)

type Cluster struct {
Expand Down Expand Up @@ -106,7 +107,7 @@ func (cluster *Cluster) cmdQueryDistributedPrograms(w http.ResponseWriter, r *ht

w.Header().Set("Content-Type", "application/json")
slaves := []string{}
for _, v := range cluster.slaves.GetALL() {
for _, v := range cluster.slaves.GetALL(true) {
if slave, ok := v.(string); ok {
slaves = append(slaves, slave)
}
Expand All @@ -119,7 +120,7 @@ func (cluster *Cluster) cmdQueryDistributedPrograms(w http.ResponseWriter, r *ht
if body, err := cluster.requestSlave(reqUrl, http.MethodGet, nil); err == nil {
jsonOut += fmt.Sprintf("\"%s\":%s", slave, body)
}
if idx < cluster.slaves.Len()-1 {
if idx < cluster.slaves.Len(true)-1 {
jsonOut += ","
}
idx += 1
Expand Down
5 changes: 3 additions & 2 deletions fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ import (

"github.com/axgle/pinyin"
"github.com/kennygrant/sanitize"
"github.com/lunny/dingtalk_webhook"
dingtalk "github.com/lunny/dingtalk_webhook"
"github.com/natefinch/lumberjack"
"github.com/qiniu/log"
"github.com/soopsio/gosuv/pushover"
"github.com/soopsio/kexec"

log "github.com/sirupsen/logrus"
)

type FSMState string
Expand Down
10 changes: 9 additions & 1 deletion gosuv.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (
"strings"

"github.com/imroc/req"
"github.com/qiniu/log"
"github.com/urfave/cli"

log "github.com/sirupsen/logrus"
)

const appID = "app_8Gji4eEAdDx"
Expand Down Expand Up @@ -113,6 +114,13 @@ func checkServerStatus() error {
func main() {
var defaultConfigPath = filepath.Join(defaultGosuvDir, "conf/config.yml")

// 设置日志格式
log.SetFormatter(&log.TextFormatter{})
// 设置日志输出位置
log.SetOutput(os.Stdout)
// 设置日志输出级别(要输出Debug信息可改为 DebugLevel 或 TraceLevel)
log.SetLevel(log.InfoLevel)

app := cli.NewApp()
app.Name = "gosuv"
app.Version = version
Expand Down
2 changes: 1 addition & 1 deletion merge_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"time"

log "github.com/qiniu/log"
log "github.com/sirupsen/logrus"
)

type Bool struct {
Expand Down
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

"github.com/qiniu/log"
log "github.com/sirupsen/logrus"
)

var ErrGoTimeout = errors.New("GoTimeoutFunc")
Expand Down
3 changes: 2 additions & 1 deletion web.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import (
"github.com/go-yaml/yaml"
"github.com/gorilla/mux"
"github.com/gorilla/websocket"
"github.com/qiniu/log"
_ "github.com/shurcooL/vfsgen"
"github.com/soopsio/gosuv/gops"
"github.com/soopsio/kexec"

log "github.com/sirupsen/logrus"
)

var defaultGosuvDir string
Expand Down