Skip to content

Commit 3c20a79

Browse files
committed
rm state-ttl only if its value default
1 parent f92c0cd commit 3c20a79

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mytonctrl/mytonctrl.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,13 @@ def Upgrade(ton, args):
381381
runArgs = ["bash", upgrade_script_path, "-a", author, "-r", repo, "-b", branch]
382382
exitCode = run_as_root(runArgs)
383383
if ton.using_validator():
384-
from mytoninstaller.mytoninstaller import set_node_argument
385-
set_node_argument(ton.local, ["--state-ttl", "-d"])
384+
try:
385+
from mytoninstaller.mytoninstaller import set_node_argument, get_node_args
386+
node_args = get_node_args()
387+
if node_args['--state-ttl'] == 604800:
388+
set_node_argument(ton.local, ["--state-ttl", "-d"])
389+
except Exception as e:
390+
color_print(f"{{red}}Failed to set node argument: {e} {{endc}}")
386391
if exitCode == 0:
387392
text = "Upgrade - {green}OK{endc}"
388393
else:

0 commit comments

Comments
 (0)