Skip to content

Commit

Permalink
Add logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
everaldorodrigo committed Sep 26, 2024
1 parent 6faa071 commit 3ac2127
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ def save_to_s3(data, filename=None, bucket="smartapi", format="zip"):
with zipfile.ZipFile(filename, 'w', zipfile.ZIP_DEFLATED) as zfile:
json_data = json.dumps(data, indent=2)
zfile.writestr(filename.replace(".zip", ".json"), json_data)
logging.info(f"Uploading {filename} to AWS S3")
s3.Bucket(bucket).upload_file(Filename=filename, Key=f"db_backup/{filename}")
else:
logging.info(f"Uploading {filename} to AWS S3")
s3.Bucket(bucket).put_object(Key=f"db_backup/{filename}", Body=json.dumps(data, indent=2))


Expand Down

0 comments on commit 3ac2127

Please sign in to comment.