Skip to content

Commit

Permalink
Only log when primary (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
davissp14 authored Jul 9, 2024
1 parent e25cee8 commit dbe8530
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/monitor/monitor_backup_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ func monitorBackupSchedule(ctx context.Context, node *flypg.Node, barman *flypg.
// Recalculate the next scheduled backup time after the initial backup.
nextScheduledBackup = calculateNextBackupTime(barman, lastBackupTime)
}

log.Printf("[INFO] Next full backup due in: %s", nextScheduledBackup)
}

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

log.Printf("[INFO] Next full backup due in: %s", nextScheduledBackup)

// Monitor the backup schedule even if we are not the primary. This is to ensure backups will
// continue to be taken in the event of a failover.
ticker := time.NewTicker(nextScheduledBackup)
Expand Down

0 comments on commit dbe8530

Please sign in to comment.