perf: 同步信息, 更新优先级

main
Lei OT 10 months ago
parent e395baeb43
commit 47c265d230

@ -186,7 +186,7 @@ class Heytrip {
}); });
const stateOffIds = stateOff.map((item) => item.hotel_id); const stateOffIds = stateOff.map((item) => item.hotel_id);
if (!isEmpty(stateOffIds)) { if (!isEmpty(stateOffIds)) {
await HeytripIds.update({ update_flag: 99, priority: 99 }, { where: { hotel_id: stateOffIds } }); await HeytripIds.update({ update_flag: 99, priority: 99 }, { where: { hotel_id: stateOffIds }, logging: false, });
console.log('updated stateOff', stateOffIds.length); console.log('updated stateOff', stateOffIds.length);
} }
return { return {
@ -260,7 +260,7 @@ class Heytrip {
WHERE h.hi2_sn IS NULL WHERE h.hi2_sn IS NULL
AND update_flag != 99 AND update_flag != 99
-- AND update_flag = 0 -- AND update_flag = 0
ORDER BY info_exists LIMIT 10` ORDER BY info_exists,priority LIMIT 10`
, { logging: false } , { logging: false }
); );
const res = await this.syncInitHotelLgcDetailsAction(rows, LGC_MAPPED[lgc]); const res = await this.syncInitHotelLgcDetailsAction(rows, LGC_MAPPED[lgc]);
@ -395,7 +395,7 @@ class Heytrip {
const offInfo = allIds.filter((iitem) => !resIds.includes(`${iitem}`)); const offInfo = allIds.filter((iitem) => !resIds.includes(`${iitem}`));
if (!isEmpty(offInfo)) { if (!isEmpty(offInfo)) {
const flag = Number(lgcObj.lgc) === 1 ? 2 : 99; // 等待获取中文数据 const flag = Number(lgcObj.lgc) === 1 ? 2 : 99; // 等待获取中文数据
const priority = Number(lgcObj.lgc) === 1 ? 0 : 99; const priority = Number(lgcObj.lgc) === 1 ? 10 : 99;
await HeytripIds.update({ update_flag: flag, priority }, { where: { hotel_id: offInfo }, ...sequelizeOptions }); await HeytripIds.update({ update_flag: flag, priority }, { where: { hotel_id: offInfo }, ...sequelizeOptions });
} }

Loading…
Cancel
Save