Cron-scheduled daemons in slug-registered directories never auto-fire (no run command found) #452
Unanswered
technicalpickles
asked this question in
Q&A
Replies: 1 comment
-
|
Get! Will fix it soon |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have two daemons configured in pitchfork. One is a long-running local web server, and the other is a separate command scheduled via cron to refresh its data every 15 minutes. The pitchfork.toml lives in a project directory and is registered via slug in
~/.config/pitchfork/config.toml. The web server stays running fine, but the cron-scheduled command never auto-fires.After digging through the supervisor log, the cron itself is firing every 15 minutes exactly on schedule. It's just refusing to run the daemon:
This repeats every quarter-hour, indefinitely.
Setup
~/.config/pitchfork/config.toml:/Users/me/path/to/my-project/pitchfork.toml:The supervisor is started via LaunchAgent on macOS, so its cwd is
$HOME(or/, depending on how launchd resolves it). The project directory is not in that cwd's ancestry.What's happening
Tracing through the source on
main:cron_watchinsrc/supervisor/watchers.rscallsself.get_daemon_run_command(&id).src/supervisor/retry.rs) callsPitchforkToml::all_merged(), which delegates toPitchforkToml::all_merged_from(&env::CWD).list_paths_from(cwd)discovers project configs by walking UP fromcwdviaxx::file::find_up_all. It does not consult slugs.$HOME, the project'spitchfork.tomlat~/path/to/my-project/pitchfork.tomlis never loaded.pt.daemons.get(id)returnsNone, the WARN fires, and the daemon is skipped.Meanwhile,
pitchfork restart my-fetchworks fine because the restart command resolves the run command via the slug, not via CWD discovery. So manual restarts anddepends-bootstraps fire the daemon as expected, but the cron schedule cannot.Reproduction
~/.config/pitchfork/config.toml, with the actual daemon config (including a cron schedule) in the project's localpitchfork.toml.INFO cron: triggering daemon ...followed byWARN no run command found for cron daemon .... The daemon never runs.pitchfork restart <daemon>works correctly. The cron just doesn't.Suggested fix
get_daemon_run_commandshould look up the daemon's source pitchfork.toml via the slug registry rather than walking up fromenv::CWD. The supervisor already knows the slug'sdir(it's in~/.config/pitchfork/config.toml), so the run command could be resolved fromPitchforkToml::all_merged_from(slug_dir)instead.Workaround
pitchfork restart <daemon>whenever the data feels stale. Setting up a system launchd timer also works as a fallback.Environment
Happy to test a fix or pull more logs if helpful.
Beta Was this translation helpful? Give feedback.
All reactions