From a588b6790629a6e58e1756a37f57110b6bdcf64a Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 26 Apr 2021 10:21:06 +0200 Subject: [PATCH] api2/config/datastore: use update_job_last_run_time for schedules this way, the api call does not error out when the file is locked currently (which means that job is running and we do not need to update the time) Signed-off-by: Dominik Csapak --- src/api2/config/datastore.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs index 3a3dc176..6ca98b53 100644 --- a/src/api2/config/datastore.rs +++ b/src/api2/config/datastore.rs @@ -375,11 +375,11 @@ pub fn update_datastore( // we want to reset the statefiles, to avoid an immediate action in some cases // (e.g. going from monthly to weekly in the second week of the month) if gc_schedule_changed { - jobstate::create_state_file("garbage_collection", &name)?; + jobstate::update_job_last_run_time("garbage_collection", &name)?; } if prune_schedule_changed { - jobstate::create_state_file("prune", &name)?; + jobstate::update_job_last_run_time("prune", &name)?; } Ok(())