Skip to content

Commit 2736c57

Browse files
committed
add disk usage warning
1 parent d6a53b0 commit 2736c57

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mytonctrl/mytonctrl.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ def PreUp(local, ton):
242242
CheckMytonctrlUpdate(local)
243243
check_installer_user()
244244
check_vport(local, ton)
245+
warnings(local, ton)
245246
# CheckTonUpdate()
246247
#end define
247248

@@ -454,6 +455,21 @@ def CheckMytonctrlUpdate(local):
454455
color_print(local.translate("mytonctrl_update_available"))
455456
#end define
456457

458+
def print_warning(local, warning_name: str):
459+
color_print("============================================================================================")
460+
color_print(local.translate(warning_name))
461+
color_print("============================================================================================")
462+
#end define
463+
464+
def check_disk_usage(local, ton):
465+
usage = ton.GetDbUsage()
466+
if usage > 90:
467+
print_warning(local, "disk_usage_warning")
468+
#end define
469+
470+
def warnings(local, ton):
471+
check_disk_usage(local, ton)
472+
457473
def CheckTonUpdate(local):
458474
git_path = "/usr/src/ton"
459475
result = check_git_update(git_path)

0 commit comments

Comments
 (0)