Skip to content

Commit 0a1214c

Browse files
committed
feat: add check about to expiry command
1 parent c1964bf commit 0a1214c

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/admin/enqueue_job.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub enum Command {
3838
#[arg(long)]
3939
force: bool,
4040
},
41+
CheckAboutToExpireToken,
4142
}
4243

4344
pub fn run(command: Command) -> Result<()> {
@@ -118,6 +119,9 @@ pub fn run(command: Command) -> Result<()> {
118119

119120
jobs::CheckTyposquat::new(&name).enqueue(conn)?;
120121
}
122+
Command::CheckAboutToExpireToken => {
123+
jobs::CheckAboutToExpireToken.enqueue(conn)?;
124+
}
121125
};
122126

123127
Ok(())

src/worker/jobs/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub use self::downloads::{
1919
CleanProcessedLogFiles, ProcessCdnLog, ProcessCdnLogQueue, UpdateDownloads,
2020
};
2121
pub use self::dump_db::DumpDb;
22+
pub use self::expiry_notification::CheckAboutToExpireToken;
2223
pub use self::git::{NormalizeIndex, SquashIndex, SyncToGitIndex, SyncToSparseIndex};
2324
pub use self::readmes::RenderAndUploadReadme;
2425
pub use self::sync_admins::SyncAdmins;

src/worker/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ impl RunnerExt for Runner<Arc<Environment>> {
3232
.register_job_type::<jobs::SyncToGitIndex>()
3333
.register_job_type::<jobs::SyncToSparseIndex>()
3434
.register_job_type::<jobs::UpdateDownloads>()
35+
.register_job_type::<jobs::CheckAboutToExpireToken>()
3536
}
3637
}

0 commit comments

Comments
 (0)