test เผยแพร่

This commit is contained in:
Adisak 2026-06-15 10:58:56 +07:00
parent 3a6d359a06
commit 5c5fc08269
4 changed files with 22 additions and 22 deletions

View file

@ -477,10 +477,10 @@ export async function BatchSavePosMasterHistoryOfficer(
const profileChanged = existing && existing.profileId !== op.profileId;
const positionChanged =
existing &&
existing.position !== op.pm?.position &&
existing.posType !== op.pm?.posType &&
existing.posLevel !== op.pm?.posLevel &&
existing.posExecutive !== op.pm?.posExecutive;
(existing.position !== op.pm?.position ||
existing.posType !== op.pm?.posType ||
existing.posLevel !== op.pm?.posLevel ||
existing.posExecutive !== op.pm?.posExecutive);
// ถ้าไม่มี record เดิม หรือ profile เปลี่ยน หรือ position เปลี่ยน ให้สร้าง record ใหม่
if (shouldInsert || profileChanged || positionChanged) {

View file

@ -1732,23 +1732,23 @@ async function clearMenuAndRoleCache(): Promise<void> {
console.log(`[AMQ] Cleared ${roleKeys.length} role cache keys`);
}
// const posMasterKeys = await keysAsync("posMaster_*");
// if (posMasterKeys.length > 0) {
// await delAsync(...posMasterKeys);
// console.log(`[AMQ] Cleared ${posMasterKeys.length} posMaster cache keys`);
// }
const posMasterKeys = await keysAsync("posMaster_*");
if (posMasterKeys.length > 0) {
await delAsync(...posMasterKeys);
console.log(`[AMQ] Cleared ${posMasterKeys.length} posMaster cache keys`);
}
// const userKeys = await keysAsync("user_*");
// if (userKeys.length > 0) {
// await delAsync(...userKeys);
// console.log(`[AMQ] Cleared ${userKeys.length} user cache keys`);
// }
const userKeys = await keysAsync("user_*");
if (userKeys.length > 0) {
await delAsync(...userKeys);
console.log(`[AMQ] Cleared ${userKeys.length} user cache keys`);
}
// const orgKeys = await keysAsync("org_*");
// if (orgKeys.length > 0) {
// await delAsync(...orgKeys);
// console.log(`[AMQ] Cleared ${orgKeys.length} org cache keys`);
// }
const orgKeys = await keysAsync("org_*");
if (orgKeys.length > 0) {
await delAsync(...orgKeys);
console.log(`[AMQ] Cleared ${orgKeys.length} org cache keys`);
}
} finally {
redisClient.quit();
}