19 lines
365 B
Python
19 lines
365 B
Python
import schedule
|
|
import time
|
|
import subprocess
|
|
|
|
|
|
def job():
|
|
subprocess.Popen(['supervisorctl restart push_stream'], shell=True)
|
|
|
|
|
|
|
|
# 每半小时执行一次
|
|
schedule.every(10).minutes.do(job)
|
|
try:
|
|
while True:
|
|
schedule.run_pending()
|
|
time.sleep(5)
|
|
except Exception as e:
|
|
subprocess.Popen(['supervisorctl restart push_stream'], shell=True)
|