Remove always zero argument to Job::new()

This commit is contained in:
link2xt
2023-02-25 02:42:14 +00:00
parent 10e8bcb73e
commit 9f804c379c
2 changed files with 4 additions and 4 deletions

View File

@@ -85,7 +85,7 @@ impl MsgId {
DownloadState::Available | DownloadState::Failure => { DownloadState::Available | DownloadState::Failure => {
self.update_download_state(context, DownloadState::InProgress) self.update_download_state(context, DownloadState::InProgress)
.await?; .await?;
job::add(context, Job::new(Action::DownloadMsg, self.to_u32(), 0)).await?; job::add(context, Job::new(Action::DownloadMsg, self.to_u32())).await?;
} }
} }
Ok(()) Ok(())

View File

@@ -85,14 +85,14 @@ impl fmt::Display for Job {
} }
impl Job { impl Job {
pub fn new(action: Action, foreign_id: u32, delay_seconds: i64) -> Self { pub fn new(action: Action, foreign_id: u32) -> Self {
let timestamp = time(); let timestamp = time();
Self { Self {
job_id: 0, job_id: 0,
action, action,
foreign_id, foreign_id,
desired_timestamp: timestamp + delay_seconds, desired_timestamp: timestamp,
added_timestamp: timestamp, added_timestamp: timestamp,
tries: 0, tries: 0,
} }
@@ -292,7 +292,7 @@ fn get_backoff_time_offset(tries: u32) -> i64 {
pub(crate) async fn schedule_resync(context: &Context) -> Result<()> { pub(crate) async fn schedule_resync(context: &Context) -> Result<()> {
kill_action(context, Action::ResyncFolders).await?; kill_action(context, Action::ResyncFolders).await?;
add(context, Job::new(Action::ResyncFolders, 0, 0)).await?; add(context, Job::new(Action::ResyncFolders, 0)).await?;
Ok(()) Ok(())
} }