Skip to content

Commit

Permalink
delete failed follows after 2d
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Oct 2, 2023
1 parent ed373f8 commit 36dd6db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/garbage.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,9 @@ func CollectGarbage(ctx context.Context, db *sql.DB) error {
return fmt.Errorf("Failed to remove old posts: %w", err)
}

if _, err := db.ExecContext(ctx, `delete from follows where accepted = 0 and inserted < unixepoch()-60*60*24*2`); err != nil {
return fmt.Errorf("Failed to remove failed follow requests: %w", err)
}

return nil
}

0 comments on commit 36dd6db

Please sign in to comment.