Skip to content

Commit dbe8530

Browse files
authored
Only log when primary (#238)
1 parent e25cee8 commit dbe8530

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/monitor/monitor_backup_schedule.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ func monitorBackupSchedule(ctx context.Context, node *flypg.Node, barman *flypg.
4747
// Recalculate the next scheduled backup time after the initial backup.
4848
nextScheduledBackup = calculateNextBackupTime(barman, lastBackupTime)
4949
}
50+
51+
log.Printf("[INFO] Next full backup due in: %s", nextScheduledBackup)
5052
}
5153

5254
// Safety net in case ticker does not have a valid duration.
5355
if nextScheduledBackup < 0 {
5456
nextScheduledBackup = backupFrequency(barman)
5557
}
5658

57-
log.Printf("[INFO] Next full backup due in: %s", nextScheduledBackup)
58-
5959
// Monitor the backup schedule even if we are not the primary. This is to ensure backups will
6060
// continue to be taken in the event of a failover.
6161
ticker := time.NewTicker(nextScheduledBackup)

0 commit comments

Comments
 (0)