Skip to content

Commit

Permalink
Add locking clause
Browse files Browse the repository at this point in the history
Co-authored-by: Staci Mullins <[email protected]>
  • Loading branch information
krysal and stacimc authored Jun 5, 2023
1 parent 62aa408 commit c47cc87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion catalog/dags/flickr_thumbs_removal.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def delete(num_thumbs):
query = dedent(
f"""
UPDATE image SET thumbnail = NULL WHERE identifier IN
(SELECT identifier {select_conditions} FETCH FIRST 10000 ROWS ONLY)
(SELECT identifier {select_conditions} FETCH FIRST 10000 ROWS ONLY FOR UPDATE SKIP LOCKED)
"""
)
pg.run(query)
Expand Down

0 comments on commit c47cc87

Please sign in to comment.