feat(web): automation settings + in-app scheduler - #97
Merged
Merged
Conversation
- Settings -> Automation: install/remove the OS job (same checks as 'eraser schedule install'), turn on the in-app scheduler, or run a cycle now. Shows mode, last run (from auto-state.json) and next run. Covers every profile. - schedule.enabled: a running 'eraser serve' runs 'eraser auto --once' as a child process every 6 hours while the OS job isn't installed, so every mode shares one cycle implementation, lock and state file. - 'Send all' refuses while a cycle is sending; the check and job start share a mutex with the scheduler so they can't pick the same brokers. - A daily-cap-paused job resumed at startup skips brokers sent since it paused, instead of emailing them again. - serve gets the -p shorthand the README already documented.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3 of the automated-sends work: everything
eraser schedule/eraser autodo, available from the web UI.Settings → Automation card
schedule.NewJob, the same checks as the CLI (the config must be valid, and ago runtemp binary is refused).schedule.enabled. This is the fallback for Windows, or for anyone who doesn't want an OS job.auto-state.json) and the next run. In OS mode that's the next fixed 00/06/12/18:07 slot; in-app it's last run + 6h.In-app scheduler (
internal/web/scheduler.go)schedule.enabledis set and no OS job is installed,serverunseraser auto --onceas a child process every 6 hours. Using the CLI cycle rather than a second copy in the web package means one send/scan path, one lock and one state file for every mode.servedoesn't trigger an extra cycle.Double-send guards
Other
serve -pworks. README anddocs/commands.mddocumented it, but the flag had no shorthand.config.example.yamland thescheduleCLI help now cover the web option.Verified in the browser against a dry-run config:
plutil -lintand points at the right binary and config → Remove leaves no plist and no loaded job.Test plan:
go vet ./... && go test ./..., and-raceonwebandschedule. New tests covercycleDue(off, never run, recent, due, OS installed), the enable/disable toggle writing the config, install refusing an invalid config, Send all returning 409 while the lock is held, andNextOSRun. The test server now keeps the schedule lock and state in a temp dir with the OS scheduler hooks stubbed out, so tests never touch the real machine.