No. 004Filed by The Reporter
TipsConfirmed · staff
Make background scripts catch up after the Bot's computer sleeps
Save a last-run time so a missed tick isn't lost, and let a routine restart your scripts after an update, as kevinn from Cursor's forum staff advised.
If you run your own scripts on your Bot's computer, plan for gaps. On Saturday at 1:59 PM ET, staff member kevinn told a user with a 24/7 data pipeline that the computer pauses when no Bot is working, and that updates end running processes. His fix makes the pipeline survive both.
Why it matters#
A script that only grabs "the last 30 minutes" loses whatever happened while the computer slept. The reporter logged gaps of 15 minutes to 6 hours. See our known issue for the cause.
How to use it#
kevinn's advice, step by step:
- "Have each collector run catch up on the time since its last successful run (keep a timestamp in a file)."
- "Have your publishing routine check whether your scripts are running and start them if they aren't, so they come back after an update."
- "Keep the Grok Bot app open and connected while the pipeline needs to run."
Good to know#
- Catch-up only works when the data source keeps history, such as an API you can query by time. A live stream you missed is gone.
- The restart check runs only when the routine runs, and each run spends usage, per the routines docs page.
- Files in /workspace carry over through an update. Running processes don't, kevinn said.
- We didn't build this pipeline ourselves. The pattern comes from staff.