Skip to content

Conversation

@wiktoriavh
Copy link
Member

No description provided.

Comment on lines 114 to 117
// Only run for days 1-25
if (day < 1 || day > 25) {
return;
}
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

Comment on lines +149 to +154
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);
});
});
Copy link
Contributor

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

Copy link
Member Author

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.

@wiktoriavh wiktoriavh merged commit 5cbdb7a into main Nov 12, 2025
1 check passed
@wiktoriavh wiktoriavh deleted the feat/daily-aoc-post branch November 12, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants