Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix startup errors, add unit test for scheduled task errors (fixes #5209) #5269

Merged
merged 6 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
Nutomic committed Dec 19, 2024
commit 53e6c3daa776494adb81a919b75d74052102e839
2 changes: 1 addition & 1 deletion .woodpecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ steps:
CARGO_HOME: .cargo_home
commands:
- cargo build
- cp target/debug/lemmy_server target/lemmy_server
- mv target/debug/lemmy_server target/lemmy_server
when: *slow_check_paths

check_diesel_migration:
Expand Down
12 changes: 4 additions & 8 deletions src/scheduled_tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ async fn delete_expired_captcha_answers(pool: &mut DbPool<'_>) -> LemmyResult<()
captcha_answer::table.filter(captcha_answer::published.lt(now() - IntervalDsl::minutes(10))),
)
.execute(&mut conn)
.await
.map(|_| {})?;
.await?;
info!("Done.");

Ok(())
Expand All @@ -313,11 +312,8 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) -> LemmyResult<()> {
}

async fn delete_old_denied_users(pool: &mut DbPool<'_>) -> LemmyResult<()> {
LocalUser::delete_old_denied_local_users(pool)
.await
.map(|_| {
info!("Done.");
})?;
LocalUser::delete_old_denied_local_users(pool).await?;
info!("Done.");
Ok(())
}

Expand Down Expand Up @@ -583,7 +579,7 @@ mod tests {

#[tokio::test]
#[serial]
async fn test_scheduled_tasks() -> LemmyResult<()> {
async fn test_scheduled_tasks_no_errors() -> LemmyResult<()> {
let context = test_context().await;

startup_jobs(&mut context.pool()).await?;
Expand Down