feat: add service startup hooks#777
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
i made this for discussion is a feature i was suggested |
|
I think it's a cool idea. My only nitpick would bet put it in the service config group instead of launchers |
Summary
Adds configurable startup ZapScript hooks:
launchers.on_service_start, which runs after the service finishes platform post-startlaunchers.on_boot_start, which runs only once per detected OS bootThe boot-scoped hook persists the last observed boot ID in the Zaparoo data directory. Linux platforms use
/proc/sys/kernel/random/boot_id; other platforms fall back to an uptime-derived boot time.Impact
This gives users a native way to run ZapScript on service startup, including launch-at-boot workflows, without external startup scripts calling the HTTP
/run/endpoint.Validation
go test ./pkg/config ./pkg/service