Skip to content

Commit 7e899a9

Browse files
committed
worker/jobs/archive_version_downloads: Inline enqueue_index_job() fn
1 parent c864a75 commit 7e899a9

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/worker/jobs/archive_version_downloads.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use super::IndexVersionDownloadsArchive;
12
use crate::schema::version_downloads;
23
use crate::tasks::spawn_blocking;
34
use crate::worker::Environment;
@@ -67,7 +68,10 @@ impl BackgroundJob for ArchiveVersionDownloads {
6768
delete(&mut conn, uploaded_dates).await?;
6869

6970
// Queue up the job to regenerate the archive index.
70-
enqueue_index_job(&mut conn).await?;
71+
IndexVersionDownloadsArchive
72+
.async_enqueue(&mut conn)
73+
.await
74+
.context("Failed to enqueue IndexVersionDownloadsArchive job")?;
7175

7276
info!("Finished archiving old version downloads");
7377
Ok(())
@@ -240,15 +244,6 @@ async fn delete(conn: &mut AsyncPgConnection, dates: Vec<NaiveDate>) -> anyhow::
240244
Ok(())
241245
}
242246

243-
async fn enqueue_index_job(conn: &mut AsyncPgConnection) -> anyhow::Result<()> {
244-
super::IndexVersionDownloadsArchive
245-
.async_enqueue(conn)
246-
.await
247-
.context("Failed to enqueue IndexVersionDownloadsArchive job")?;
248-
249-
Ok(())
250-
}
251-
252247
#[cfg(test)]
253248
mod tests {
254249
use super::*;

0 commit comments

Comments
 (0)