Skip to content

Commit

Permalink
Marked as queued a long time ago
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-finley committed Sep 3, 2024
1 parent cc83221 commit 0442ba4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion queue_files/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ def run(event, context):
except Exception as err:
print(f"Failed to delete {clean_name}: {err}")

# also reenque all failed files
# also reenque all failed files or queued a long time ago
with conn.cursor() as cursor:
cursor.execute(
"""
SELECT id, desktop_path
FROM dropbox
WHERE status = 'failed'
OR (status = 'pending' AND created_at < CURRENT_TIMESTAMP - INTERVAL '1 hour')
FOR UPDATE SKIP LOCKED
"""
)
Expand Down

0 comments on commit 0442ba4

Please sign in to comment.