Merge branch 'main' into debug_auth_headers

This commit is contained in:
Dessalines 2023-11-06 16:43:59 -05:00 committed by GitHub
commit 539f1d8717
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -295,14 +295,17 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
match conn {
Ok(mut conn) => {
diesel::delete(sent_activity::table.filter(sent_activity::published.lt(now() - 3.months())))
.execute(&mut conn)
.await
.map_err(|e| error!("Failed to clear old sent activities: {e}"))
.ok();
diesel::delete(
sent_activity::table.filter(sent_activity::published.lt(now() - IntervalDsl::days(7))),
)
.execute(&mut conn)
.await
.map_err(|e| error!("Failed to clear old sent activities: {e}"))
.ok();
diesel::delete(
received_activity::table.filter(received_activity::published.lt(now() - 3.months())),
received_activity::table
.filter(received_activity::published.lt(now() - IntervalDsl::days(7))),
)
.execute(&mut conn)
.await