danReynolds / loon

Loon is a reactive document data store for Dart & Flutter.
https://pub.dev/packages/loon
MIT License
35 stars 2 forks source link

Sync operation #9

Closed danReynolds closed 4 months ago

danReynolds commented 4 months ago

Rewrites the file persistor syncing to be run on a timer with a mutex to guard operations reading/writing the file system. The bug was that each operation (persist, clear, etc) was blocking on the sync running, making the sync to operation ratio 1:1. This was not the intention of the sync throttling, it is meant to allow as many operations to run as are scheduled, but then block them when the sync timer fires so that it can sync to the system and then resume running operations.