added sync mutex for consistency checks and backup

This commit is contained in:
azivner
2018-01-04 21:37:36 -05:00
parent a6a687c4a6
commit 663bd1a8fe
7 changed files with 61 additions and 40 deletions

8
services/sync_mutex.js Normal file
View File

@@ -0,0 +1,8 @@
/**
* Sync makes process can make data intermittently inconsistent. Processes which require strong data consistency
* (like consistency checks) can use this mutex to make sure sync isn't currently running.
*/
const Mutex = require('async-mutex').Mutex;
module.exports = new Mutex();