File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -43,21 +43,25 @@ def count():
43
43
44
44
@task ()
45
45
def delete (num_thumbs ):
46
+ log_sql = True
46
47
if num_thumbs == 0 :
47
48
logger .info ("No Flickr thumbnails found." )
48
49
49
50
while num_thumbs > 0 :
50
51
query = dedent (
51
52
f"""
52
- UPDATE image SET thumbnail = NULL WHERE identifier IN
53
- (SELECT identifier { select_conditions } FETCH FIRST 10000 ROWS ONLY FOR UPDATE SKIP LOCKED)
53
+ UPDATE image SET thumbnail = NULL WHERE identifier IN (
54
+ SELECT identifier { select_conditions }
55
+ FETCH FIRST 10000 ROWS ONLY FOR UPDATE SKIP LOCKED
56
+ )
54
57
"""
55
58
)
56
- pg .run (query )
59
+ pg .run (query , log_sql = log_sql )
57
60
num_thumbs -= 10000
58
61
logger .info (
59
62
f"Flickr thumbnails left: { num_thumbs if num_thumbs > 0 else 0 } ."
60
63
)
64
+ log_sql = False
61
65
62
66
@task ()
63
67
def report ():
You can’t perform that action at this time.
0 commit comments