public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/2] api2/config/datastore: use update_job_last_run_time for schedules
Date: Mon, 26 Apr 2021 10:21:06 +0200	[thread overview]
Message-ID: <20210426082106.22024-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20210426082106.22024-1-d.csapak@proxmox.com>

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 <d.csapak@proxmox.com>
---
 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(())
-- 
2.20.1





      reply	other threads:[~2021-04-26  8:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26  8:21 [pbs-devel] [PATCH proxmox-backup 1/2] server/jobstate: improve name of 'try_update_state_file' Dominik Csapak
2021-04-26  8:21 ` Dominik Csapak [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210426082106.22024-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal