diff --git a/src/common/core/letsencrypt/jobs/certbot-new.py b/src/common/core/letsencrypt/jobs/certbot-new.py index d64a3d2b9..f8b9fe3da 100755 --- a/src/common/core/letsencrypt/jobs/certbot-new.py +++ b/src/common/core/letsencrypt/jobs/certbot-new.py @@ -97,7 +97,7 @@ try: sqlalchemy_string=getenv("DATABASE_URI", None), ) - tgz = get_file_in_db("folder.tgz", db) + tgz = get_file_in_db("folder.tgz", db, job_name="certbot-renew") if tgz: # Delete folder if needed if letsencrypt_path.exists(): diff --git a/src/common/utils/jobs.py b/src/common/utils/jobs.py index 43d35aa88..5fa98724d 100644 --- a/src/common/utils/jobs.py +++ b/src/common/utils/jobs.py @@ -70,9 +70,9 @@ def is_cached_file( return is_cached and cached_file -def get_file_in_db(file: Union[str, Path], db) -> Optional[bytes]: +def get_file_in_db(file: Union[str, Path], db, *, job_name: Optional[str] = None) -> Optional[bytes]: cached_file = db.get_job_cache_file( - basename(getsourcefile(_getframe(1))).replace(".py", ""), normpath(file) + job_name or basename(getsourcefile(_getframe(1))).replace(".py", ""), normpath(file) ) if not cached_file: return None