Merge branch 'develop' into hide-notification-on-click
This commit is contained in:
commit
9d70f2c4a7
1 changed files with 2 additions and 5 deletions
|
|
@ -65,10 +65,7 @@ def get_latest_backup_file(with_files=False):
|
|||
return database, config
|
||||
|
||||
|
||||
def get_file_size(file_path, unit):
|
||||
if not unit:
|
||||
unit = "MB"
|
||||
|
||||
def get_file_size(file_path, unit='MB'):
|
||||
file_size = os.path.getsize(file_path)
|
||||
|
||||
memory_size_unit_mapper = {"KB": 1, "MB": 2, "GB": 3, "TB": 4}
|
||||
|
|
@ -99,7 +96,7 @@ def get_chunk_site(file_size):
|
|||
def validate_file_size():
|
||||
frappe.flags.create_new_backup = True
|
||||
latest_file, site_config = get_latest_backup_file()
|
||||
file_size = get_file_size(latest_file, unit="GB")
|
||||
file_size = get_file_size(latest_file, unit="GB") if latest_file else 0
|
||||
|
||||
if file_size > 1:
|
||||
frappe.flags.create_new_backup = False
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue