feat: daily aoc post#37
Conversation
…ion in Discord forum
…t with error handling
…ename guides-tracker.json
…d update related references
…s and server configuration
…ted only in December
| // Only run for days 1-25 | ||
| if (day < 1 || day > 25) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Why this specific date range?
There was a problem hiding this comment.
Because advent of code runs till Christmas.
There was a problem hiding this comment.
But isn't it 12 days only?
There was a problem hiding this comment.
It was always 25 days, this time it is only 12 puzzles. i don't know yet how it will be. i will update the job once i have more information, but for the first day this will run correctly.
There was a problem hiding this comment.
it's based on the advent calendar (24 or 25 days long), so it being only 12 is very weird. it could be that it only runs from day 1 to day 12, or it will run to day 24, where every other day a puzzle is posted? unclear to me yet.
| cron.schedule('0 5 * * *', () => { | ||
| console.log('⏰ Running scheduled Advent of Code check...'); | ||
| checkAndCreateTodaysPost(client, channelId).catch((error) => { | ||
| console.error('❌ Error in scheduled Advent of Code check:', error); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
cron.schedule(
'0 0 * * *',
() => {
console.log('⏰ Running scheduled Advent of Code check...');
checkAndCreateTodaysPost(client, channelId).catch((error) => {
console.error('❌ Error in scheduled Advent of Code check:', error);
});
},
{
timezone: 'America/New_York',
}
);This way the expression is more understandable, it uses 0s (midnight) and has the timezone visible vs having to read in as UTC
There was a problem hiding this comment.
I'd prefer to specifically have it run on UTC. It's the standard for the time.
…ed error parameter
No description provided.