| 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 |
no outgoing calls
no test coverage detected