Add a warning on the periodic resyncer (open sqlite databases)
Refactor sync_wait logic into a function