-
Notifications
You must be signed in to change notification settings - Fork 1
feat: daily aoc post #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
src/util/advent-scheduler.ts
Outdated
| // Only run for days 1-25 | ||
| if (day < 1 || day > 25) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this specific date range?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because advent of code runs till Christmas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But isn't it 12 days only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to specifically have it run on UTC. It's the standard for the time.
…ed error parameter
No description provided.