アラートが発行されない不具合を修正
This commit is contained in:
parent
db4fe14316
commit
3cef58cab3
1 changed files with 6 additions and 5 deletions
|
@ -21,23 +21,24 @@ export const work = async () => {
|
||||||
|
|
||||||
clearLog();
|
clearLog();
|
||||||
|
|
||||||
printLog('[Miss-hai Worker] Started.');
|
printLog('Started.');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const users = await Users.find({ alertMode: Not<AlertMode>('nothing') });
|
const users = await Users.find({ alertMode: Not<AlertMode>('nothing') });
|
||||||
|
printLog('will process ' + users.length + ' accounts.');
|
||||||
for (const user of users) {
|
for (const user of users) {
|
||||||
await update(user).catch(e => handleError(user, e));
|
await update(user).catch(e => handleError(user, e));
|
||||||
printLog(`[Miss-hai Worker] processed for ${user.username}@${user.host}`);
|
printLog(`processed for ${user.username}@${user.host}`);
|
||||||
|
|
||||||
if (user.alertMode === 'note') {
|
if (user.alertMode === 'note') {
|
||||||
return delay(3000);
|
await delay(3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printLog('[Miss-hai Worker] finished successfully.');
|
printLog('finished successfully.');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const msg = String(e instanceof Error ? e.stack : e);
|
const msg = String(e instanceof Error ? e.stack : e);
|
||||||
printLog(msg);
|
printLog(msg);
|
||||||
printLog('[Miss-hai Worker] stopped wrongly.');
|
printLog('stopped wrongly.');
|
||||||
} finally {
|
} finally {
|
||||||
Store.dispatch({ nowCalculating: false });
|
Store.dispatch({ nowCalculating: false });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue