mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-27 09:15:10 +00:00
fix: check if s3 object is a directory by checking the start of the object ContentType property
This commit is contained in:
parent
66fca59f74
commit
46440d3894
1 changed files with 1 additions and 1 deletions
|
|
@ -75,7 +75,7 @@ def delete_old_backups(limit, bucket, site_name):
|
||||||
for obj in objects.get("CommonPrefixes"):
|
for obj in objects.get("CommonPrefixes"):
|
||||||
if obj.get("Prefix") == bucket_dir + "/":
|
if obj.get("Prefix") == bucket_dir + "/":
|
||||||
for backup_obj in bucket.objects.filter(Prefix=obj.get("Prefix")):
|
for backup_obj in bucket.objects.filter(Prefix=obj.get("Prefix")):
|
||||||
if backup_obj.get()["ContentType"] == "application/x-directory":
|
if backup_obj.get()["ContentType"].startswith("application/x-directory"):
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
# backup_obj.key is bucket_dir/site/date_time/backupfile.extension
|
# backup_obj.key is bucket_dir/site/date_time/backupfile.extension
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue