程序优化

This commit is contained in:
dongchangxi committed 2023-12-09 15:47:49 +08:00
1 parent e83deda268
commit e1a7647fcb
16 files changed
+634 -91

No files matched your search

+1 -4
View File
@@ -192,10 +192,7 @@ 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}'
sql = 'select * from task_distributed where status =0 order by priority desc limit 1 for update'
cursor.execute(sql)
result = cursor.fetchone()
# 关闭游标和连接