зеркало из https://github.com/Azure/etcd-operator.git
backup interval should have a minimal value (#13)
This commit is contained in:
Родитель
43cdbcea75
Коммит
bd82df887d
|
@ -32,6 +32,10 @@ func (b *Backup) handle(spec *api.BackupSpec) (*api.BackupStatus, error) {
|
|||
func (b *Backup) handleBackupSchedule(spec *api.BackupSpec) {
|
||||
interval := spec.BackupSchedule.BackupIntervalInSecond
|
||||
if interval >= 0 {
|
||||
// we can only support BackupInterval greater than a certain value
|
||||
if interval < minBackupIntervalInSecond {
|
||||
interval = minBackupIntervalInSecond
|
||||
}
|
||||
go func() {
|
||||
if spec.BackupSchedule.MaxBackups == 0 {
|
||||
return
|
||||
|
|
|
@ -26,6 +26,8 @@ const (
|
|||
//
|
||||
// 5ms, 10ms, 20ms, 40ms, 80ms, 160ms, 320ms, 640ms, 1.3s, 2.6s, 5.1s, 10.2s, 20.4s, 41s, 82s
|
||||
maxRetries = 15
|
||||
// Minimal backup interval we can use
|
||||
minBackupIntervalInSecond = 60
|
||||
)
|
||||
|
||||
func (b *Backup) runWorker() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче