diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-11-18 20:00:21 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-11-18 20:00:21 -1000 |
commit | 731d0e8aa243bfcd9de8fcea3fd3cdd3d64bde14 (patch) | |
tree | 3704539244c33adebfa3e894a405ae529372c2b4 /lib | |
parent | 58cd6d811c22ab2eba24513595e176ecc91fad28 (diff) | |
download | patchfoo-731d0e8aa243bfcd9de8fcea3fd3cdd3d64bde14.tar.gz patchfoo-731d0e8aa243bfcd9de8fcea3fd3cdd3d64bde14.zip |
Fix status page
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.js | 12 | ||||
-rw-r--r-- | lib/serve.js | 2 |
2 files changed, 13 insertions, 1 deletions
@@ -1102,3 +1102,15 @@ App.prototype.getShard = function (id, cb) { }) }) } + +App.prototype.sbotStatus = function (cb) { + /* sbot.status is a "sync" method. if we are a plugin, it is sync. if we are + * calling over muxrpc, it is async. */ + var status + try { + status = this.sbot.status(cb) + } catch(err) { + return cb(err) + } + if (typeof status === 'object' && status !== null) return cb(null, status) +} diff --git a/lib/serve.js b/lib/serve.js index 3db1c3c..4188269 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -795,7 +795,7 @@ Serve.prototype.status = function (ext) { ph('h3', 'Status'), pull( u.readNext(function (cb) { - self.app.sbot.status(function (err, status) { + self.app.sbotStatus(function (err, status) { cb(err, status && pull.once(status)) }) }), |