fix clean-s3-cache.py
This commit is contained in:
parent
b55385699c
commit
e315306fa7
2 changed files with 9 additions and 6 deletions
|
@ -1,6 +1,12 @@
|
|||
{ writeTextFile }: writeTextFile {
|
||||
{ writeTextFile, python3, python3Packages }:
|
||||
let environment = python3.buildEnv.override {
|
||||
extraLibs = with python3Packages; [
|
||||
boto3
|
||||
];
|
||||
}; in
|
||||
writeTextFile {
|
||||
name = "clean-s3-cache.py";
|
||||
executable = true;
|
||||
destination = "/bin/clean-s3-cache.py";
|
||||
text = builtins.readFile ./clean-s3-cache.py;
|
||||
text = builtins.replaceStrings [ "#SHEBANG#" ] [ "${environment}/bin/python" ] (builtins.readFile ./clean-s3-cache.py);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i python3 -p python -p python3Packages.boto3
|
||||
#!#SHEBANG#
|
||||
|
||||
import asyncio
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
@ -91,13 +90,11 @@ async def list_old_cache_objects() -> AsyncIterable[str]:
|
|||
) -> dict[str, Any]:
|
||||
if ContinuationToken != None:
|
||||
return s3.list_objects_v2(
|
||||
Prefix="realisations/",
|
||||
Bucket=BUCKET_NAME,
|
||||
ContinuationToken=ContinuationToken
|
||||
)
|
||||
else:
|
||||
return s3.list_objects_v2(
|
||||
Prefix="realisations/",
|
||||
Bucket=BUCKET_NAME
|
||||
)
|
||||
cont_token = None
|
||||
|
|
Loading…
Reference in a new issue