git ssb

1+

Dominic / secure-scuttlebutt



Commit 9abf028ebc9401a7ab89e1b9a71b915b79a5757d

flush before closing

Dominic Tarr committed on 1/18/2019, 9:40:00 PM
Parent: dd961e4fbaf5321a314266adbcd32ac22ec3d413

Files changed

index.jschanged
index.jsView
@@ -52,13 +52,16 @@
5252 var feed = ssb.createFeed(opts.keys, {remote: true})
5353 var _close = api.close
5454 var close = function (arg, cb) {
5555 if('function' === typeof arg) cb = arg
56- // override to close the SSB database
57- ssb.close(function (err) {
58- if (err) throw err
59- console.log("fallback to close")
60- _close(cb) //multiserver doesn't take a callback on close.
56+ ssb.flush(function (err) {
57+ if(err) return cb(err)
58+ // override to close the SSB database
59+ ssb.close(function (err) {
60+ if (err) return cb(err)
61+ console.log("fallback to close")
62+ _close(cb) //multiserver doesn't take a callback on close.
63+ })
6164 })
6265 }
6366
6467 function since () {

Built with git-ssb-web