分布式处理和脚底板文件
This commit is contained in:
1 parent
f4254f0051
commit
2c036235a6
19 files changed
+1932
-56
No files matched your search
+21
-1
@@ -185,4 +185,24 @@ def update_task_distributed_detail(data):
|
||||
except Exception as e:
|
||||
print(f"{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())} 执行update_task_distributed_detail({data})异常: {str(e)}")
|
||||
logging.error(f"{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())} 执行update_task_distributed_detail({data})异常: {str(e)}")
|
||||
return "error"
|
||||
return "error"
|
||||
|
||||
#获取需要执行step1的任务
|
||||
def get_task_distributed_step1():
|
||||
try:
|
||||
with pymysqlAlias() as conn:
|
||||
cursor = conn.cursor(pymysql.cursors.DictCursor)
|
||||
sql = 'select * from task_distributed where status =0 order by priority desc limit 1'
|
||||
if where:
|
||||
sql += f' and {where}'
|
||||
|
||||
cursor.execute(sql)
|
||||
result = cursor.fetchone()
|
||||
# 关闭游标和连接
|
||||
##cursor.close()
|
||||
#conn.close()
|
||||
return result
|
||||
except Exception as e:
|
||||
print(f"{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())} 执行get_task_distributed_step1()异常: {str(e)}")
|
||||
logging.error(f"{time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())} 执行get_task_distributed_step1()异常: {str(e)}")
|
||||
return 'error'
|
||||
Reference in new issue
Block a user