Skip to content

feat: daily aoc post#37

Merged
wiktoriavh merged 21 commits into
mainfrom
feat/daily-aoc-post
Nov 12, 2025
Merged

feat: daily aoc post#37
wiktoriavh merged 21 commits into
mainfrom
feat/daily-aoc-post

Conversation

@wiktoriavh
Copy link
Copy Markdown
Member

No description provided.

Comment thread src/util/advent-scheduler.ts Outdated
Comment on lines +114 to +117
// Only run for days 1-25
if (day < 1 || day > 25) {
return;
}
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 thread src/util/advent-scheduler.ts Outdated
Comment thread src/util/advent-scheduler.ts Outdated
Comment thread src/util/advent-scheduler.ts Outdated
Comment thread src/util/advent-scheduler.ts Outdated
Comment thread src/util/advent-scheduler.ts Outdated
Comment thread src/util/advent-scheduler.ts Outdated
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
Copy Markdown
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
Copy Markdown
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.

Comment thread test/advent-scheduler.test.mjs Outdated
Comment thread test/advent-scheduler.test.mjs Outdated
@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.

2 participants