Skip to content

Commit

Permalink
removed some dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Aug 15, 2024
1 parent 7d49327 commit 7627762
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions scheduler/src/periodic-tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,49 +47,6 @@ def is_expired(status, since, size=0):
return since < now - datetime.timedelta(seconds=int(size / min_bps))


def remove_image(image_fname, upload_uri):

# use manager credentials to be able to delete files over FTP
username = "manager"
req = requests.post(
url="{api_url}/auth/authorize".format(
api_url=os.getenv("CARDSHOP_API_INTERNAL_URL")
),
headers={
"username": "manager",
"password": os.getenv("MANAGER_API_KEY"),
"Content-type": "application/json",
},
)
try:
req.raise_for_status()
except Exception:
return False
access_token = req.json().get("access_token")

args = [
"/usr/bin/curl",
"--connect-timeout",
"60",
"--insecure",
"--ipv4",
"--retry-connrefused",
"--retry-delay",
"60",
"--retry",
"20",
"--stderr",
"-",
"--user",
"{user}:{passwd}".format(user=username, passwd=access_token),
upload_uri,
"-Q",
"-DELE {}".format(image_fname),
]

return subprocess.run(args).returncode == 0


def run_periodic_tasks():
logger.info("running periodic tasks !!")

Expand Down

0 comments on commit 7627762

Please sign in to comment.