904118851 4 ヶ月 前
コミット
1e6942c088
1 ファイル変更4 行追加0 行削除
  1. 4 0
      task_script/async_filter_data.js

+ 4 - 0
task_script/async_filter_data.js

@@ -21,12 +21,15 @@ async function processTask(){
             multipleStatements: true
         });
 
+        await connection.beginTransaction();
+
         let sql = `SELECT * FROM filter_data WHERE tg_platform_id = ${tg_platform_id} AND status = 0 AND weight = 0 LIMIT 1`
         
         const [row] = await connection.execute(sql)
 
 
         if(row.length<=0){
+            await connection.commit();
             throw 0
         }
 
@@ -56,6 +59,7 @@ async function processTask(){
             sql
         );
 
+        await connection.commit();
     }catch(e){
         if(e==0){
             right_status = false