[Employer Sync 5.3] Run employer sync hourly and enforce cron ordering
TL;DR: Schedule the employer sync 20 * * * * (hourly at :20 past). Document the company → location → employer ordering both in the YAML comment and the spec doc so a future engineer rescheduling one of the jobs cannot accidentally break the dependency.
Context
The existing gig syncs run daily. For employers — who keep being created in JodGig until the sunset finishes — a daily cadence means up to 24 hours of "I cannot log in" for any new employer. That is exactly when sales is reaching out.
Problem
PR #1634 schedules the employer sync daily, at 15:20 UTC. Even with the detect-and-enqueue path from issue 5.2, an hourly cadence on the main sync is healthier — JIT covers the urgent case, the hourly batch covers everything else.
There is also a real ordering dependency. The employer sync must run after the company sync (companies must exist in JodApp first) and after the location sync (outlets must exist first). Nothing today enforces that.
Direction
Update config/sidekiq_scheduler.yml:
JodGig_Employers_SyncJob:
cron: '20 * * * *' # hourly, at :20 past
class: JodGig::Users::EmployersSyncJob
queue: default
description: "Sync any new or updated jodgig employer users into JodApp."
:20 past the hour keeps the daily-anchor ordering intact: the company sync runs at 0 15 * * * (15:00 UTC), the location sync at 10 15 * * * (15:10 UTC), and the employer sync at 20 * * * * first fires at 15:20 UTC. Subsequent hourly runs do not re-check the company/location sync — they just rely on the data already being in place.
Add a comment block to the YAML documenting the ordering dependency (company → location → employer).
In the spec doc (issue 1.1), add a "Cron ordering" section that states the dependency in plain English, so a future engineer who reschedules one of the jobs notices.
Acceptance
- Scheduler entry merged; cron is
20 * * * *. - YAML comment explains the ordering dependency.
- Spec doc updated.
Depends on
- 3.1 (the job class must exist before it is scheduled)