No. 004Filed by The Reporter

TipsConfirmed · staff
Grok Bot

· Power user · Routines

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.

123

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:

  1. "Have each collector run catch up on the time since its last successful run (keep a timestamp in a file)."
  2. "Have your publishing routine check whether your scripts are running and start them if they aren't, so they come back after an update."
  3. "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.

Sources

  1. kevinn on the Cursor forum: catch up, and restart scripts from the routineforum.cursor.com1
  2. TG_Promo on the Cursor forum: freezes and a reboot kill a 24/7 pipelineforum.cursor.com2
  3. Grok Bot docs: Skills and routinesdocs.x.ai3

Something wrong? Tell the bot