Skip to content

Commit 589c205

Browse files
committed
fix: checking no rows to prune.
1 parent 6babb89 commit 589c205

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

informative-indexer/prunner/prunner.go

+5
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ func (p *Prunner) pruningTable(ctx context.Context, tableName string) error {
112112
if err != nil {
113113
return fmt.Errorf("DB: Failed to fetch rows to prune from table %s: %w", tableName, err)
114114
}
115+
// no rows to prune
116+
if len(rowsToPrune) == 0 {
117+
logger.Info().Msgf("Pruning not required for table %s: no rows to prune", tableName)
118+
return nil
119+
}
115120

116121
backupFileName := fmt.Sprintf("%s-%d.zip", p.config.BackupFilePrefix, time.Now().Unix())
117122
if err := backupToGCS(ctx, p.storageClient, p.config.BackupBucketName, tableName, backupFileName, rowsToPrune); err != nil {

0 commit comments

Comments
 (0)