cleanup: replace id from do_sync_job with info from job

we already have it inside the job itself

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2020-08-13 14:30:18 +02:00
committed by Dietmar Maurer
parent 77bd2a469c
commit 713b66b6ed
4 changed files with 15 additions and 8 deletions

View File

@ -90,7 +90,7 @@ fn run_sync_job(
let mut job = Job::new("syncjob", &id)?;
job.load()?;
let upid_str = do_sync_job(&id, sync_job, &userid, None, job)?;
let upid_str = do_sync_job(job, sync_job, &userid, None)?;
Ok(upid_str)
}

View File

@ -66,19 +66,18 @@ pub async fn get_pull_parameters(
}
pub fn do_sync_job(
id: &str,
mut job: Job,
sync_job: SyncJobConfig,
userid: &Userid,
schedule: Option<String>,
mut job: Job,
) -> Result<String, Error> {
let job_id = id.to_string();
let worker_type = "syncjob";
let job_id = job.jobname().to_string();
let worker_type = job.jobtype().to_string();
let upid_str = WorkerTask::spawn(
worker_type,
Some(id.to_string()),
&worker_type,
Some(job.jobname().to_string()),
userid.clone(),
false,
move |worker| async move {