git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit a5ab0fcd21ce8f881036e23c0db45f31bdd8ec38

flush if scheduler is not running

Norton Wang committed on 3/6/2018, 11:59:37 PM
Parent: a14ec41fadf0f202a60992c8b084dfcb9a786ad9

Files changed

index.jschanged
index.jsView
@@ -100,11 +100,15 @@
100100 * @returns {Promise}
101101 */
102102 createStateRoot () {
103103 return new Promise((resolve, reject) => {
104- this.scheduler.on('idle', () => {
104+ if (!this.scheduler._running) {
105105 this.tree.flush().then(resolve)
106- })
106+ } else {
107+ this.scheduler.on('idle', () => {
108+ this.tree.flush().then(resolve)
109+ })
110+ }
107111 })
108112 }
109113
110114 /**

Built with git-ssb-web