Skip to content

Commit 65cf2c2

Browse files
0xPoeTurbo87
authored andcommitted
feat: add a check about to expiry command
1 parent d0e6331 commit 65cf2c2

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
@@ -44,6 +44,7 @@ pub enum Command {
4444
#[arg(long)]
4545
force: bool,
4646
},
47+
CheckAboutToExpireToken,
4748
}
4849

4950
pub fn run(command: Command) -> Result<()> {
@@ -130,6 +131,9 @@ pub fn run(command: Command) -> Result<()> {
130131

131132
jobs::CheckTyposquat::new(&name).enqueue(conn)?;
132133
}
134+
Command::CheckAboutToExpireToken => {
135+
jobs::CheckAboutToExpireToken.enqueue(conn)?;
136+
}
133137
};
134138

135139
Ok(())

src/worker/jobs/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub use self::downloads::{
2222
CleanProcessedLogFiles, ProcessCdnLog, ProcessCdnLogQueue, UpdateDownloads,
2323
};
2424
pub use self::dump_db::DumpDb;
25+
pub use self::expiry_notification::CheckAboutToExpireToken;
2526
pub use self::git::{NormalizeIndex, SquashIndex, SyncToGitIndex, SyncToSparseIndex};
2627
pub use self::readmes::RenderAndUploadReadme;
2728
pub use self::sync_admins::SyncAdmins;

src/worker/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ impl RunnerExt for Runner<Arc<Environment>> {
3434
.register_job_type::<jobs::SyncToSparseIndex>()
3535
.register_job_type::<jobs::UpdateDownloads>()
3636
.register_job_type::<jobs::UpdateDefaultVersion>()
37+
.register_job_type::<jobs::CheckAboutToExpireToken>()
3738
}
3839
}

0 commit comments

Comments
 (0)