diff --git a/cmd/storemsgcounter/execute.go b/cmd/storemsgcounter/execute.go index 298f7b0..887ca75 100644 --- a/cmd/storemsgcounter/execute.go +++ b/cmd/storemsgcounter/execute.go @@ -534,7 +534,10 @@ func (app *Application) fetchStoreNodeMessages(ctx context.Context, runId string cursorLogger.Error("could not query storenode", zap.Error(err)) time.Sleep(2 * time.Second) } else { - cursorLogger.Info("more messages available", zap.Int("len", len(result.Messages()))) + msgLen := len(result.Messages()) + if msgLen != 0 { + cursorLogger.Info("more messages available", zap.Int("len", msgLen)) + } retry = false success = true } diff --git a/internal/persistence/database.go b/internal/persistence/database.go index fff7906..bdd975f 100644 --- a/internal/persistence/database.go +++ b/internal/persistence/database.go @@ -279,7 +279,7 @@ func (d *DBStore) GetMissingMessages(from time.Time, to time.Time) (map[peer.ID] } func (d *DBStore) UpdateTopicSyncState(tx *sql.Tx, topic string, lastSyncTimestamp time.Time) error { - _, err := tx.Exec("INSERT INTO syncTopicStatus(fleet, clusterId, pubsubTopic, lastSyncTimestamp) VALUES ($1, $2, $3, $4) ON CONFLICT(fleet, clusterId, pubsubTopic) DO UPDATE SET lastSyncTimestamp = $5", d.fleetName, d.clusterID, topic, lastSyncTimestamp.UnixNano(), lastSyncTimestamp.UnixNano()) + _, err := tx.Exec("INSERT INTO syncTopicStatus(fleet, clusterId, pubsubTopic, lastSyncTimestamp) VALUES ($1, $2, $3, $4) ON CONFLICT(clusterId, pubsubTopic) DO UPDATE SET lastSyncTimestamp = $5", d.fleetName, d.clusterID, topic, lastSyncTimestamp.UnixNano(), lastSyncTimestamp.UnixNano()) return err }