feat(config): add savepoint interval config

This commit is contained in:
2024-11-30 02:18:44 +03:30
parent 8f4cb093b1
commit e95634c942
3 changed files with 9 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ func (job *ManagedJob) cycle() {
if errors.Is(err, ErrNoJobId) {
job.state = nil
}
if job.state.LastSavepointDate == nil || time.Now().Add(-time.Minute*3).After(*job.state.LastSavepointDate) {
if job.state.LastSavepointDate == nil || time.Now().Add(-job.def.SavepointInterval).After(*job.state.LastSavepointDate) {
if job.state.SavepointTriggerId == nil {
job.createSavepoint()
} else {