
- 移动 OrderTask 控制器到 task 模块- 更新 Task 控制器的命名空间和引用 - 调整日志删除功能的位置 - 优化订单处理相关函数 - 移除未使用的代码和注释
32 lines
905 B
Python
32 lines
905 B
Python
#!/usr/bin/env python
|
||
# -*- coding: utf-8 -*-
|
||
# dm_process为key,value为具体指令 如:call office-convert_call id=1
|
||
import time
|
||
import os
|
||
#import pprint
|
||
#import subprocess
|
||
#from gevent import monkey; monkey.patch_socket()
|
||
#import gevent
|
||
timeSleep = 15
|
||
|
||
def popen(command, bg=False):
|
||
string = command
|
||
if bg == True:
|
||
command = command + ' &'
|
||
process = os.popen(command)
|
||
output = process.read()
|
||
process.close()
|
||
return output
|
||
|
||
# 定时执行进程
|
||
def process():
|
||
command = 'php /www/wwwroot/reapi/public/index.php task/api.orderTask/cron 1>/dev/null 2>&1 &'
|
||
check = 'ps -ef | grep orderTask/orderTask/cron | grep -v grep | wc -l'
|
||
i = 0
|
||
while 1:
|
||
value = int(popen(check))
|
||
if value == 0:
|
||
popen(command)
|
||
time.sleep(timeSleep)
|
||
|
||
process() |