1
0
mirror of https://github.com/keycloak/keycloak.git synced 2026-10-23 19:29:23 +03:00
Files
keycloak/model
Manas Choksi adf2dd6104 Record the start of a periodic user-storage sync run as lastSync
The periodic sync gate (isSyncPeriod) skipped the next timer tick whenever
a sync run took longer than about a second, so the effective sync period
doubled. The timer schedules each run 'period' seconds after the start of
the previous run, but lastSync recorded the time the previous run
finished, so the tick landed less than period - 1 seconds after the
recorded time and was ignored.

Capture the start of the sync run before executing it and stamp that
into lastSync when the run succeeds, mirroring the timer's start-anchored
scheduling. A run that throws still leaves lastSync untouched, so the
next tick retries as before. Incremental sync also no longer misses
entries changed while the previous run was in progress, as syncSince now
receives the start of the previous run instead of its finish.

Fixes keycloak#53930

Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
2026-10-14 15:17:33 -03:00
..