Skip to content

fix(pipes): run missed cron slot when app restarts late#3684

Merged
louis030195 merged 1 commit into
screenpipe:mainfrom
Anshgrover23:fix/cron-missed-slot-catchup
May 29, 2026
Merged

fix(pipes): run missed cron slot when app restarts late#3684
louis030195 merged 1 commit into
screenpipe:mainfrom
Anshgrover23:fix/cron-missed-slot-catchup

Conversation

@Anshgrover23

Copy link
Copy Markdown
Contributor

Description:

If a pipe was scheduled (e.g. morning-brief at 7am) but the app was offline during that window, the pipe was silently skipped and would not run until the next day. Starting the app at 7:12am meant the 7am slot was already outside the 5-minute lookback window — so it was dropped.

Fix :

  • The 5-minute grace window is now only applied to newly-installed pipes (no prior run history), which still need it to prevent firing immediately on install.

  • For previously-run pipes, the scheduler searches from the last run time directly, so any slot missed while the app was offline fires on the next tick when the app restarts.

If the app was offline during a scheduled pipe run (e.g. morning-brief
at 7am, app starts at 7:12am), the pipe now fires immediately on the
next scheduler tick instead of silently waiting until tomorrow.

Previously a hardcoded 5-minute grace window prevented any catch-up.
The window is now only applied to newly-installed pipes (never run
before) to prevent them from firing immediately on install.
@Anshgrover23 Anshgrover23 force-pushed the fix/cron-missed-slot-catchup branch from 05d6d4b to 5e31028 Compare May 29, 2026 14:25
@Anshgrover23

Copy link
Copy Markdown
Contributor Author

@louis030195 Can I get a review on this one ?

@louis030195 louis030195 merged commit bc52497 into screenpipe:main May 29, 2026
8 of 11 checks passed
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