From c08709ff4544f7a218b6568931206f7140626a27 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Fri, 23 Jul 2021 16:48:19 +0200 Subject: [PATCH] do not try to run interactive docker function --- setup-scripts/blocklist-airtable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup-scripts/blocklist-airtable.py b/setup-scripts/blocklist-airtable.py index de16f533..62f44951 100755 --- a/setup-scripts/blocklist-airtable.py +++ b/setup-scripts/blocklist-airtable.py @@ -100,11 +100,11 @@ async def block_skylinks_from_airtable(): batch_size = 1000 for i in range(0, len(skylinks), batch_size): cached_files_command = ( - "find /data/nginx/cache/ -type f | xargs --no-run-if-empty -n" + str(batch_size) + " grep -Els '^Skynet-Skylink: (" + "find /data/nginx/cache/ -type f | xargs -r grep -Els '^Skynet-Skylink: (" + "|".join(skylinks[i:i+batch_size]) + ")'" ) - cached_files_count+= int(exec('docker exec -it nginx bash -c "' + cached_files_command + ' | xargs -r rm -v | wc -l"')) + cached_files_count+= int(exec('docker exec nginx bash -c "' + cached_files_command + ' | xargs -r rm -v | wc -l"')) if cached_files_count == 0: return print("No nginx cached files matching blocked skylinks were found")