feat(rfid): more rfid topics while monitoring the system run

This commit is contained in:
2025-07-10 20:09:35 -05:00
parent 58711becf2
commit 6a082d9737
10 changed files with 87 additions and 12 deletions

View File

@@ -8,7 +8,22 @@ export const noRead = async (reader: string) => {
createLog(
"error",
"rfid",
"rifd",
"rfid",
`${reader} just had a no read please check for a tag and manually trigger a read.`
);
};
// noReadTimer.js
let timeout: any = null;
export const startNoReadTimer = (onTimeout: any, ms = 10000) => {
clearNoReadTimer(); // Always clear any previous timer
timeout = setTimeout(onTimeout, ms);
};
export const clearNoReadTimer = () => {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
};