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:
parent
79c9bf55b9
commit
c724f65805
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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())?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue