Commit fb258d94 by ‘chizw’

[+]限制优化

1 parent 21203ba4
...@@ -37,17 +37,17 @@ def update_ali_asr_model_res(task_id: str, json_output: str, execute_time: int): ...@@ -37,17 +37,17 @@ def update_ali_asr_model_res(task_id: str, json_output: str, execute_time: int):
def update_ali_asr_model_res_fail(task_id: str, exception_msg: str, exception: str): def update_ali_asr_model_res_fail(task_id: str, exception_msg: str, exception: str):
update_sql = ( update_sql = (
"update ali_asr_model_res t set t.task_status = case when exception_limit >= %s then 2 else 0 end, " "update ali_asr_model_res t set exception_limit = exception_limit + 1, "
"t.exception_msg = %s, t.exception_log = %s, " "t.exception_msg = %s, t.exception_log = %s, "
"exception_limit = exception_limit + 1 " "t.task_status = case when exception_limit >= %s then 2 else 0 end "
"where t.task_id = %s and del_flag = 0;") "where t.task_id = %s and del_flag = 0;")
return pool.update_one(update_sql, (EXCEPTION_LIMIT, exception_msg, exception, task_id,)) return pool.update_one(update_sql, (EXCEPTION_LIMIT, exception_msg, exception, task_id,))
def update_ali_asr_model_res_skip(task_id: str): def update_ali_asr_model_res_skip(task_id: str):
update_sql = ( update_sql = (
"update ali_asr_model_res t set t.task_status = case when exception_limit >= %s then 2 else 0 end," "update ali_asr_model_res t set exception_limit = exception_limit + 1,"
"exception_limit = exception_limit + 1 " "t.task_status = case when exception_limit >= %s then 2 else 0 end "
"where t.task_id = %s and del_flag = 0;") "where t.task_id = %s and del_flag = 0;")
return pool.update_one(update_sql, (EXCEPTION_LIMIT, task_id,)) return pool.update_one(update_sql, (EXCEPTION_LIMIT, task_id,))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!