fix(server): encode ServerKey in base64 and update last reported time for nodes
This commit is contained in:
@@ -3,6 +3,7 @@ package server
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/hibiken/asynq"
|
||||
"github.com/perfect-panel/server/internal/svc"
|
||||
@@ -51,5 +52,15 @@ func (l *ServerPushUserTrafficLogic) ServerPushUserTraffic(req *types.ServerPush
|
||||
} else {
|
||||
l.Infow("[ServerPushUserTraffic] Push traffic task success", logger.Field("task", t), logger.Field("info", info))
|
||||
}
|
||||
|
||||
// Update server last reported time
|
||||
now := time.Now()
|
||||
serverInfo.LastReportedAt = &now
|
||||
|
||||
err = l.svcCtx.NodeModel.UpdateServer(l.ctx, serverInfo)
|
||||
if err != nil {
|
||||
l.Errorw("[ServerPushUserTraffic] UpdateServer error", logger.Field("error", err))
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user