Skip to content

Commit

Permalink
chore: update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed Apr 1, 2024
1 parent af6b1b3 commit 8f2f2e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/worker/jobs/expiry_notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ impl BackgroundJob for ExpiryNotification {
#[instrument(skip(env), err)]

Check warning on line 25 in src/worker/jobs/expiry_notification.rs

View check run for this annotation

Codecov / codecov/patch

src/worker/jobs/expiry_notification.rs#L25

Added line #L25 was not covered by tests
async fn run(&self, env: Self::Context) -> anyhow::Result<()> {
let mut conn = env.connection_pool.get()?;
// Check if the token is expired
// If the token is expired, trigger a notification
// Check if the token is about to expire
// If the token is about to expire, trigger a notification
check(&env.emails, &mut conn)
}
}

// Check if the token is expired and trigger a notification if it is.
// Check if the token is about to expire and send a notification if it is.
fn check(emails: &Emails, conn: &mut PgConnection) -> anyhow::Result<()> {
info!("Checking if tokens are expired");
info!("Checking if tokens are about to expire");
let expired_tokens =
crate::models::token::ApiToken::find_tokens_expiring_within_days(conn, EXPIRY_THRESHOLD)?;
// Batch send notifications in transactions.
Expand Down

0 comments on commit 8f2f2e5

Please sign in to comment.