Commit graph

2 commits

Author SHA1 Message Date
Dan Stillman
3f6ecc0021 Fix "Can't queue event outside of a transaction"
If a transaction took over 30 seconds and another transaction timed out
waiting for it, the second transaction would reset the notifier queue,
but if the first transaction then tried to queue an event, it would fail
with this error and roll back. (It would be nice to figure out why
transactions are taking over 30 seconds, though.)
2018-02-08 02:07:44 -05:00
Dan Stillman
f1af54236e Add Zotero.Notifier.Queue to keep event groups separate, and use for sync
A queue can be created and passed as an option to data layer methods, which
will then queue events on that queue instead of the main internal queue. A
queue or an array of queues can then be passed to Zotero.Notifier.commit() to
commit those events.

Some auxiliary functions don't yet take a queue, so those events will still get
run on DB transaction commit.

Sync data processing now processes notifier events in batches to reduce
repaints, even though individual objects are processed within their own
transactions (so that failures don't roll back other objects' data).

Also remove some unused notifier code
2016-04-22 22:48:58 -04:00