server/gc_job: add 'to_stdout'

we will use this for the manual api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-11-02 12:34:37 +01:00 committed by Thomas Lamprecht
parent 79c9bf55b9
commit c724f65805
2 changed files with 3 additions and 2 deletions

View File

@ -334,7 +334,7 @@ async fn schedule_datastore_garbage_collection() {
let auth_id = Authid::backup_auth_id(); let auth_id = Authid::backup_auth_id();
if let Err(err) = crate::server::do_garbage_collection_job(job, datastore, auth_id, Some(event_str)) { if let Err(err) = crate::server::do_garbage_collection_job(job, datastore, auth_id, Some(event_str), false) {
eprintln!("unable to start garbage collection job on datastore {} - {}", store, err); eprintln!("unable to start garbage collection job on datastore {} - {}", store, err);
} }
} }

View File

@ -14,6 +14,7 @@ pub fn do_garbage_collection_job(
datastore: Arc<DataStore>, datastore: Arc<DataStore>,
auth_id: &Authid, auth_id: &Authid,
schedule: Option<String>, schedule: Option<String>,
to_stdout: bool,
) -> Result<String, Error> { ) -> Result<String, Error> {
let email = crate::server::lookup_user_email(auth_id.user()); let email = crate::server::lookup_user_email(auth_id.user());
@ -25,7 +26,7 @@ pub fn do_garbage_collection_job(
&worker_type, &worker_type,
Some(store.clone()), Some(store.clone()),
auth_id.clone(), auth_id.clone(),
false, to_stdout,
move |worker| { move |worker| {
job.start(&worker.upid().to_string())?; job.start(&worker.upid().to_string())?;