diff --git a/src/services/worker.ts b/src/services/worker.ts index d6fcdf1..b165759 100644 --- a/src/services/worker.ts +++ b/src/services/worker.ts @@ -5,12 +5,14 @@ import { Users } from '../models'; import { deleteUser } from '../functions/users'; import { updateScore } from '../functions/update-score'; import { send } from './send'; +import { Not } from 'typeorm'; +import { AlertMode } from '../types/AlertMode'; export default (): void => { cron.schedule('0 0 0 * * *', async () => { - const users = await Users.createQueryBuilder() - .select() - .getMany(); + const users = await Users.find({ + alertMode: Not('nothing'), + }); for (const user of users) { try { await send(user);