Skip to content

Commit

Permalink
fix: add federated worker index count (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
brucexc authored Nov 21, 2024
1 parent 7fb5450 commit 7147cec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/node/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ func (m *Monitor) processDecentralizedWorker(ctx context.Context, w *config.Modu

// processFederatedWorker processes the federated worker status.
func (m *Monitor) processFederatedWorker(ctx context.Context, w *config.Module) error {
// get checkpoint info from database
indexCount, _, err := m.getCheckpointState(ctx, w.ID, w.Network, w.Worker.Name())
if err != nil {
zap.L().Error("get checkpoint info", zap.Error(err))
return err
}

if err = m.UpdateWorkerProgress(ctx, w.ID, ConstructWorkerProgress(0, 0, 0, indexCount)); err != nil {
return fmt.Errorf("update worker progress: %w", err)
}

client, ok := m.clients[w.Network]
if !ok {
return fmt.Errorf("client not exist")
Expand Down

0 comments on commit 7147cec

Please sign in to comment.