-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
95 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,18 +128,18 @@ export class ScheduleService { | |
} | ||
|
||
// ERROR [Scheduler] ServerError: Can't send mail - all recipients were rejected: 550 <[email protected]> No such user here | ||
@Cron('37 17 * * Sun', { | ||
name: 'MonthlyCampaigns try At 17:37 on Sunday.', // we try every week and only send to those who did not receive (because their child have no needs, etc.) | ||
@Cron('00 17 * * Sun', { | ||
name: 'MonthlyCampaigns try At 17:00 on Sunday.', // we try every week and only send to those who did not receive (because their child have no needs, etc.) | ||
timeZone: 'Asia/Tehran', | ||
}) | ||
async handleMonthlyCampaignsCron() { | ||
const farsiDay = persianDay(new Date()); | ||
// if (farsiDay > 20) { | ||
// this.logger.warn( | ||
// `We are near the end of this month let's skip one more week`, | ||
// ); | ||
// return; | ||
// } | ||
if (farsiDay > 20) { | ||
this.logger.warn( | ||
`We are near the end of this month let's skip one more week`, | ||
); | ||
return; | ||
} | ||
// ############## BE CAREFUL ################# | ||
if (process.env.NODE_ENV === 'production') { | ||
this.logger.debug( | ||
|
@@ -160,11 +160,16 @@ export class ScheduleService { | |
} | ||
} | ||
|
||
@Timeout(5000) | ||
@Cron('30 9 * * Wed', { | ||
name: 'Reminders to announce arrivals At 09:30 on Wednesday.', | ||
timeZone: 'Asia/Tehran', | ||
}) | ||
async handleAnnounceArrivalCron() { | ||
if (process.env.NODE_ENV === 'production') { | ||
// this.logger.debug('Sending Reminder to Social workers to announce arrivals'); | ||
// await this.campaignService.sendSwAnnounceReminder(); | ||
this.logger.debug( | ||
'Sending Reminder to Social workers to announce arrivals', | ||
); | ||
await this.campaignService.sendSwAnnounceReminder(); | ||
} | ||
} | ||
// @Cron('30 8 * * Sat', { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters