Skip to content

Commit

Permalink
feat: add check about to expiry command
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed Apr 5, 2024
1 parent c1964bf commit 0a1214c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/admin/enqueue_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub enum Command {
#[arg(long)]
force: bool,
},
CheckAboutToExpireToken,
}

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

jobs::CheckTyposquat::new(&name).enqueue(conn)?;
}
Command::CheckAboutToExpireToken => {
jobs::CheckAboutToExpireToken.enqueue(conn)?;

Check warning on line 123 in src/admin/enqueue_job.rs

View check run for this annotation

Codecov / codecov/patch

src/admin/enqueue_job.rs#L123

Added line #L123 was not covered by tests
}
};

Ok(())
Expand Down
1 change: 1 addition & 0 deletions src/worker/jobs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub use self::downloads::{
CleanProcessedLogFiles, ProcessCdnLog, ProcessCdnLogQueue, UpdateDownloads,
};
pub use self::dump_db::DumpDb;
pub use self::expiry_notification::CheckAboutToExpireToken;
pub use self::git::{NormalizeIndex, SquashIndex, SyncToGitIndex, SyncToSparseIndex};
pub use self::readmes::RenderAndUploadReadme;
pub use self::sync_admins::SyncAdmins;
Expand Down
1 change: 1 addition & 0 deletions src/worker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ impl RunnerExt for Runner<Arc<Environment>> {
.register_job_type::<jobs::SyncToGitIndex>()
.register_job_type::<jobs::SyncToSparseIndex>()
.register_job_type::<jobs::UpdateDownloads>()
.register_job_type::<jobs::CheckAboutToExpireToken>()
}
}

0 comments on commit 0a1214c

Please sign in to comment.