background data sync should be synchronous, but adjust sleep so flushAll is called on the interval so if sync delay 60 seconds, and sync takes 5 seconds, next sleep should be 55 seconds.