This commit is contained in:
parent
97a4fb9a72
commit
cb01427dcf
1 changed files with 9 additions and 6 deletions
|
@ -295,14 +295,17 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
|
||||||
|
|
||||||
match conn {
|
match conn {
|
||||||
Ok(mut conn) => {
|
Ok(mut conn) => {
|
||||||
diesel::delete(sent_activity::table.filter(sent_activity::published.lt(now() - 3.months())))
|
diesel::delete(
|
||||||
.execute(&mut conn)
|
sent_activity::table.filter(sent_activity::published.lt(now() - IntervalDsl::days(7))),
|
||||||
.await
|
)
|
||||||
.map_err(|e| error!("Failed to clear old sent activities: {e}"))
|
.execute(&mut conn)
|
||||||
.ok();
|
.await
|
||||||
|
.map_err(|e| error!("Failed to clear old sent activities: {e}"))
|
||||||
|
.ok();
|
||||||
|
|
||||||
diesel::delete(
|
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)
|
.execute(&mut conn)
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Reference in a new issue