MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / ProjectDemons

Class ProjectDemons

task.py:3007–3025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3005 # interval=3600)
3006
3007 class ProjectDemons(_Script):
3008 def __init__(self, ):
3009 super().__init__("项目守护进程", '', 120)
3010 self.cmd = 'nohup {} {}/script/project_daemon.py > /dev/null 2>&1 &'.format(
3011 PY_BIN, PANEL_PATH
3012 )
3013
3014 def get_next_time(self) -> int:
3015 daemon_time_file ='{}/data/daemon_time.pl'.format(PANEL_PATH)
3016 if os.path.exists(daemon_time_file):
3017 time_out = int(read_file(daemon_time_file))
3018 if time_out < 10:
3019 time_out = 10
3020 if time_out > 30 * 60:
3021 time_out = 30 * 60
3022 else:
3023 time_out = 120
3024
3025 return int(time.time() + time_out)
3026
3027 project_demons = ProjectDemons()
3028

Callers 1

start_scripts_serviceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected