4.1 KiB
| phase | plan | subsystem | tags | key-decisions | status | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| quick-260721-fy8 | 01 | sync-scheduler |
|
|
complete |
Quick Task 260721-fy8: Fix mimecast and qbo sync scheduler dispatch and reschedule mimecast cron
One-liner: Added missing mimecast-sync and qbo dispatch branches to sync-scheduler.ts (both previously fell through to a generic Autotask full sync, silently never running their real sync logic) and rescheduled mimecast-sync off the 2am three-way cron collision with qbo-sync-2am and veeam-full.
What was done
Task 1 — Dispatch branches (lib/services/sync-scheduler.ts, commit 9311f10)
- Extended the
ScheduleConfig.sync_typeunion to add'mimecast-sync'('qbo'was already present). - Added an
else if (config.sync_type === 'mimecast-sync')branch: dynamically importsisMimecastConfiguredfrommimecast-client.ts; if not configured, logs a skip line matching the engagement/zoom wording. Otherwise dynamically imports and callsrunMimecastIncrementalSync()frommimecast-sync-service.ts, logging a one-line summary using the realMimecastSyncResultfields (messagesUpserted,threatsUpserted,bodiesFetched,purgedMessages,errors.length,durationMs). - Added an
else if (config.sync_type === 'qbo')branch: queriesintegration_settingsforkey = 'qbo'(mirroring thepax8-dailydisable-check pattern exactly); if disabled, logs a skip line; otherwise dynamically importsgetQboSyncServiceand calls.incrementalSync('scheduled'). - Both new branches sit before the final
'incremental'branch and catch-allelse, which are unchanged — the catch-all remains reachable only for'full'/legacy full-sync types. npx tsc --noEmit --prettypasses clean.
Task 2 — Reschedule migration (migrations/101_reschedule_mimecast_sync.sql, commit f447ac3)
- New guarded migration:
UPDATE sync_schedules SET cron_expression = '45 4 * * *', updated_at = NOW() WHERE id = 'mimecast-sync' AND cron_expression = '0 2 * * *'— a no-op if already moved, safe against clobbering a manual admin change. - Applied the same UPDATE directly against the live
pulse-postgrescontainer (migrations only auto-apply on first volume boot per CLAUDE.md) — confirmed live:mimecast-syncnow reads45 4 * * *;qbo-sync-2amandveeam-fullunchanged at0 2 * * *(collision eliminated for mimecast-sync specifically, as intended — qbo-sync-2am and veeam-full no longer contend with mimecast-sync, though qbo-sync-2am and veeam-full still share 2am with each other, which was out of scope for this task).
Verification
npx tsc --noEmit --pretty— clean.- Live DB:
SELECT cron_expression FROM sync_schedules WHERE id = 'mimecast-sync'→45 4 * * *. - No existing branch (
phishing-sweep,pax8-daily,veeam-*,incremental, catch-all) modified. - No test file exists for
sync-scheduler.ts(onlymimecast-client.test.ts), so no test changes were made, per plan constraint.
Deviations from plan
None. Both tasks executed exactly as planned.
Note on this SUMMARY.md
This file was originally written by the executor inside its isolated git worktree but was lost when the orchestrator removed the worktree (git worktree remove --force) without first running the standard rescue-before-remove step. Reconstructed immediately after from the executor's final report text and the actual git show output of both commits — content is accurate but not verbatim the original (same recovery situation documented previously in this repo for quick task 260717-a19).