letsencrypt - use same job name when retrieving data from db
This commit is contained in:
parent
9e00b9dd13
commit
94867d0d63
|
@ -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():
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue