From ae018c58cd85a1505075c898d0f75d60901298cf Mon Sep 17 00:00:00 2001 From: zhaochenyang Date: Wed, 24 Jan 2024 15:37:09 +0800 Subject: [PATCH] refactor(lcnode): hybrid cloud add start time in heartbeat Signed-off-by: zhaochenyang --- lcnode/lc_op.go | 5 +++-- lcnode/lc_scanner.go | 3 +-- master/api_service.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lcnode/lc_op.go b/lcnode/lc_op.go index 91a018757..8e15896fd 100644 --- a/lcnode/lc_op.go +++ b/lcnode/lc_op.go @@ -58,8 +58,9 @@ func (l *LcNode) opMasterHeartbeat(conn net.Conn, p *proto.Packet, remoteAddr st l.scannerMutex.RLock() for _, scanner := range l.lcScanners { result := &proto.LcNodeRuleTaskResponse{ - ID: scanner.ID, - LcNode: l.localServerAddr, + ID: scanner.ID, + LcNode: l.localServerAddr, + StartTime: &scanner.now, LcNodeRuleTaskStatistics: proto.LcNodeRuleTaskStatistics{ Volume: scanner.Volume, RuleId: scanner.rule.ID, diff --git a/lcnode/lc_scanner.go b/lcnode/lc_scanner.go index 35dfd837c..804b9e1a7 100644 --- a/lcnode/lc_scanner.go +++ b/lcnode/lc_scanner.go @@ -213,8 +213,7 @@ func (s *LcScanner) Start() (err error) { Path: strings.TrimPrefix(currentPath, pathSep), Type: uint32(os.ModeDir), } - t := time.Now() - response.StartTime = &t + response.StartTime = &s.now s.firstIn(firstDentry) diff --git a/master/api_service.go b/master/api_service.go index 6cec9e2f2..cfc62d3f4 100644 --- a/master/api_service.go +++ b/master/api_service.go @@ -6907,7 +6907,7 @@ func (m *Server) SetBucketLifecycle(w http.ResponseWriter, r *http.Request) { } _ = m.cluster.SetBucketLifecycle(&req) - sendOkReply(w, r, newSuccessHTTPReply("PutBucketLifecycleConfiguration successful")) + sendOkReply(w, r, newSuccessHTTPReply(fmt.Sprintf("set vol[%v] lifecycle successfully", vol.Name))) } func allowedStorageClass(sc string, allowed []uint32) bool {