aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-11-18 20:00:21 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-11-18 20:00:21 -1000
commit731d0e8aa243bfcd9de8fcea3fd3cdd3d64bde14 (patch)
tree3704539244c33adebfa3e894a405ae529372c2b4
parent58cd6d811c22ab2eba24513595e176ecc91fad28 (diff)
downloadpatchfoo-731d0e8aa243bfcd9de8fcea3fd3cdd3d64bde14.tar.gz
patchfoo-731d0e8aa243bfcd9de8fcea3fd3cdd3d64bde14.zip
Fix status page
-rw-r--r--lib/app.js12
-rw-r--r--lib/serve.js2
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/app.js b/lib/app.js
index b49b378..fb27e78 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -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))
})
}),