This commit is contained in:
Karol Wypchlo 2021-03-01 18:41:41 +01:00
parent b92bfe0150
commit 1d9215fdd1
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ async def block_skylinks_from_airtable():
message = "Siad blocklist endpoint responded with code " + str(response.status_code) + ": " + (response.text or "empty response") message = "Siad blocklist endpoint responded with code " + str(response.status_code) + ": " + (response.text or "empty response")
return print(message) or await send_msg(client, message, force_notify=True) return print(message) or await send_msg(client, message, force_notify=True)
print("Purging nginx cache containing blocked skylinks") print("Searching nginx cache for blocked files")
cached_files_command = '/usr/bin/find /data/nginx/cache/ -type f | /usr/bin/xargs --no-run-if-empty -n1000 /bin/grep -El \'^KEY: .*(' + '|'.join(skylinks) + ')\'' cached_files_command = '/usr/bin/find /data/nginx/cache/ -type f | /usr/bin/xargs --no-run-if-empty -n1000 /bin/grep -El \'^KEY: .*(' + '|'.join(skylinks) + ')\''
cached_files_count = int(os.popen('docker exec -it nginx bash -c "' + cached_files_command + ' | wc -l"').read().strip()) cached_files_count = int(os.popen('docker exec -it nginx bash -c "' + cached_files_command + ' | wc -l"').read().strip())