add delta sync before each reconcile, have it not repeat if it's been done in the last minute

This commit is contained in:
Miloš Jovanović 2026-09-24 20:01:01 -07:00
parent ccb6b3277d
commit f98a23418f
3 changed files with 22 additions and 0 deletions

View file

@ -6,6 +6,9 @@ import (
)
func (s *Server) reconcile(ctx context.Context, runID int64, rep *User, dept string) error {
if err := s.syncIfStale(ctx, time.Minute); err != nil {
log.Printf("run %d: pre-run sync failed, using cached roster: %v", runID, err)
}
reps, err := s.store.RepsFor(rep.ChapterID, dept)
if err != nil {
return err