程序优化
This commit is contained in:
1 parent
e83deda268
commit
e1a7647fcb
16 files changed
+634
-91
No files matched your search
@@ -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()
|
||||
# 关闭游标和连接
|
||||
|
||||
Reference in new issue
Block a user