Commit 1dd800ed by ‘chizw’

[+]sql优化

1 parent c4e0293f
...@@ -29,7 +29,9 @@ def insert_ali_asr_model_res(task_id: str, url: str): ...@@ -29,7 +29,9 @@ def insert_ali_asr_model_res(task_id: str, url: str):
def update_ali_asr_model_res(task_id: str, json_output: str, execute_time: int): def update_ali_asr_model_res(task_id: str, json_output: str, execute_time: int):
update_sql = ( update_sql = (
"update ali_asr_model_res t set t.output_data = %s,t.task_status = 1, t.execute_time = %s where t.task_id = %s;") "update ali_asr_model_res t set t.output_data = %s,t.task_status = 1, t.execute_time = %s "
"where t.task_id = %s and del_flag = 0;"
)
return pool.update_one(update_sql, (json_output, execute_time, task_id,)) return pool.update_one(update_sql, (json_output, execute_time, task_id,))
...@@ -37,7 +39,7 @@ def update_ali_asr_model_res_fail(task_id: str, exception_msg: str, exception: s ...@@ -37,7 +39,7 @@ def update_ali_asr_model_res_fail(task_id: str, exception_msg: str, exception: s
update_sql = ( update_sql = (
"update ali_asr_model_res t set t.task_status = 2, t.exception_msg = %s, t.exception_log = %s, " "update ali_asr_model_res t set t.task_status = 2, t.exception_msg = %s, t.exception_log = %s, "
"exception_limit = exception_limit + 1 " "exception_limit = exception_limit + 1 "
"where t.task_id = %s;") "where t.task_id = %s and del_flag = 0;")
return pool.update_one(update_sql, (exception_msg, exception, task_id,)) return pool.update_one(update_sql, (exception_msg, exception, task_id,))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!