mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-28 17:50:56 +01:00
refactor(all): refactor code
remove redundant code and some code refactor
This commit is contained in:
@@ -2,6 +2,7 @@ package msg_handler
|
||||
|
||||
import (
|
||||
"crawlab/constants"
|
||||
"crawlab/database"
|
||||
"crawlab/entity"
|
||||
"crawlab/model"
|
||||
"crawlab/utils"
|
||||
@@ -39,7 +40,7 @@ func (g *Log) get() error {
|
||||
msgSd.Log = utils.BytesToString(logStr)
|
||||
}
|
||||
// 发布消息给主节点
|
||||
if err := utils.Pub(constants.ChannelMasterNode, msgSd); err != nil {
|
||||
if err := database.Pub(constants.ChannelMasterNode, msgSd); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -2,9 +2,9 @@ package msg_handler
|
||||
|
||||
import (
|
||||
"crawlab/constants"
|
||||
"crawlab/database"
|
||||
"crawlab/entity"
|
||||
"crawlab/model"
|
||||
"crawlab/utils"
|
||||
)
|
||||
|
||||
type SystemInfo struct {
|
||||
@@ -22,7 +22,7 @@ func (s *SystemInfo) Handle() error {
|
||||
NodeId: s.msg.NodeId,
|
||||
SysInfo: sysInfo,
|
||||
}
|
||||
if err := utils.Pub(constants.ChannelMasterNode, msgSd); err != nil {
|
||||
if err := database.Pub(constants.ChannelMasterNode, msgSd); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user