Skip to content

Commit 8091c5d

Browse files
author
yandaifei
committed
修改检测时间间隔
1 parent a543831 commit 8091c5d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

check-process.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,35 +58,35 @@ def notification(content):
5858
def handle_check_remote():
5959
url = 'http://182.61.33.241:8111/league/api/nim/consultant/find'
6060
try:
61-
print('正在检测' + url)
61+
notification('正在检测' + url)
6262
requests.post(url, timeout=10)
6363
except:
6464
notification('该后台服务没有正常运行:' + url)
6565

6666
url = 'http://woniujia.juke8.cn/league/api/nim/consultant/find'
6767
try:
68-
print('正在检测' + url)
68+
notification('正在检测' + url)
6969
requests.post(url, timeout=10)
7070
except:
7171
notification('该后台服务没有正常运行:' + url)
7272

7373
url = 'https://apis.juke8.cn/dsp/ex/weixin/user/login-by-code'
7474
try:
75-
print('正在检测' + url)
75+
notification('正在检测' + url)
7676
requests.post(url, timeout=10)
7777
except:
7878
notification('该后台服务没有正常运行:' + url)
7979

8080
url = 'http://www.juke8.cn:8086/admin/api/project-config/1.0/private/project/list/paging?page_size=10&page=1'
8181
try:
82-
print('正在检测' + url)
82+
notification('正在检测' + url)
8383
requests.post(url, timeout=10)
8484
except:
8585
notification('该后台服务没有正常运行:' + url)
8686

8787
url = 'http://dsp.juke8.cn/admin-console/#/projectConfig?p=god_bless_dsp'
8888
try:
89-
print('正在检测' + url)
89+
notification('正在检测' + url)
9090
requests.post(url, timeout=10)
9191
except:
9292
notification('该后台服务没有正常运行:' + url)
@@ -110,7 +110,7 @@ def main():
110110
with daemon.DaemonContext():
111111
scheduler = BlockingScheduler()
112112
# scheduler.add_job(handle_check, 'interval', seconds=3,args=[process_name,cmd])
113-
scheduler.add_job(handle_check_remote, 'interval', seconds=500)
113+
scheduler.add_job(handle_check_remote, 'interval', seconds=60)
114114

115115
try:
116116
scheduler.start()

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apscheduler
2+
requests
3+
psutil
4+
python-daemon

0 commit comments

Comments
 (0)