src/server/worker_task.rs: Avoid using pbs-api-type::Authid

Because we want to move worker_task.rs into proxmox-rest-server crate.
This commit is contained in:
Dietmar Maurer
2021-09-21 12:14:19 +02:00
parent 4d4f94dedf
commit 049a22a3a3
25 changed files with 55 additions and 51 deletions

View File

@ -26,7 +26,7 @@ pub fn do_garbage_collection_job(
let upid_str = WorkerTask::new_thread(
&worker_type,
Some(store.clone()),
auth_id.clone(),
auth_id.to_string(),
to_stdout,
move |worker| {
job.start(&worker.upid().to_string())?;

View File

@ -105,7 +105,7 @@ pub fn do_prune_job(
let upid_str = WorkerTask::new_thread(
&worker_type,
Some(job.jobname().to_string()),
auth_id.clone(),
auth_id.to_string(),
false,
move |worker| {
job.start(&worker.upid().to_string())?;

View File

@ -36,7 +36,7 @@ pub fn do_verification_job(
let upid_str = WorkerTask::new_thread(
&worker_type,
Some(job_id.clone()),
auth_id.clone(),
auth_id.to_string(),
to_stdout,
move |worker| {
job.start(&worker.upid().to_string())?;

View File

@ -18,7 +18,7 @@ use proxmox::tools::fs::{create_path, replace_file, CreateOptions};
use pbs_buildcfg;
use pbs_tools::logrotate::{LogRotate, LogRotateFiles};
use pbs_api_types::{Authid, UPID};
use pbs_api_types::UPID;
use pbs_config::{open_backup_lockfile, BackupLockGuard};
use proxmox_rest_server::{CommandoSocket, FileLogger, FileLogOptions};
@ -589,7 +589,7 @@ struct WorkerTaskData {
impl WorkerTask {
pub fn new(worker_type: &str, worker_id: Option<String>, auth_id: Authid, to_stdout: bool) -> Result<Arc<Self>, Error> {
pub fn new(worker_type: &str, worker_id: Option<String>, auth_id: String, to_stdout: bool) -> Result<Arc<Self>, Error> {
let upid = UPID::new(worker_type, worker_id, auth_id)?;
let task_id = upid.task_id;
@ -640,7 +640,7 @@ impl WorkerTask {
pub fn spawn<F, T>(
worker_type: &str,
worker_id: Option<String>,
auth_id: Authid,
auth_id: String,
to_stdout: bool,
f: F,
) -> Result<String, Error>
@ -662,7 +662,7 @@ impl WorkerTask {
pub fn new_thread<F>(
worker_type: &str,
worker_id: Option<String>,
auth_id: Authid,
auth_id: String,
to_stdout: bool,
f: F,
) -> Result<String, Error>