Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
use awaitReady: false to make more responsive on initial sync
Browse files Browse the repository at this point in the history
depends on flumedb/flumedb#22 fork
  • Loading branch information
mmckegg committed Dec 5, 2018
1 parent e4ec072 commit 7f52d1b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
16 changes: 7 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -34,6 +34,7 @@
"fix-path": "^2.1.0",
"flat": "^4.1.0",
"flatpickr": "^4.5.2",
"flumedb": "github:mmckegg/flumedb#add-await-ready-option",
"flumeview-level": "^3.0.6",
"flumeview-reduce": "^1.3.14",
"hashlru": "^2.2.1",
Expand Down Expand Up @@ -69,7 +70,7 @@
"scuttlebot": "^13.0.3",
"sorted-array-functions": "^1.1.0",
"spacetime": "^4.5.1",
"ssb-about": "^2.0.0",
"ssb-about": "github:ssbc/ssb-about#use-await-ready",
"ssb-backlinks": "^0.7.3",
"ssb-blob-files": "github:ssbc/ssb-blob-files#localizable-errors-and-early-return",
"ssb-blobs": "^1.1.6",
Expand Down
3 changes: 2 additions & 1 deletion sbot/channel-feed.js
Expand Up @@ -28,7 +28,7 @@ exports.init = function (ssb, config) {
dest: `#${channel}`
} }]
return pull(
ssb.backlinks.read({ old: false, live: true, query }),
ssb.backlinks.read({ old: false, live: true, query, awaitReady: false }),
pull.filter(msg => checkBump(msg, { channel })),
LookupRoots({ ssb, cache })
// TODO: don't bump if author blocked
Expand All @@ -45,6 +45,7 @@ exports.init = function (ssb, config) {

var opts = {
reverse,
awaitReady: false,
old: true,
query: [{ $filter: {
dest: `#${channel}`,
Expand Down
4 changes: 2 additions & 2 deletions sbot/profile.js
Expand Up @@ -146,7 +146,7 @@ exports.init = function (ssb, config) {
},
latest: function ({ id }) {
return pull(
ssb.createUserStream({ id, live: true, old: false }),
ssb.createUserStream({ id, live: true, old: false, awaitReady: false }),
pull.filter(bumpFilter),
LookupRoots({ ssb, cache }),
pull.filter(msg => {
Expand All @@ -162,7 +162,7 @@ exports.init = function (ssb, config) {
roots: function ({ id, limit, reverse, resume }) {
// use resume option if specified

var opts = { id, reverse, old: true }
var opts = { id, reverse, old: true, awaitReady: false }
if (resume) {
opts[reverse ? 'lt' : 'gt'] = resume
}
Expand Down
4 changes: 2 additions & 2 deletions sbot/public-feed.js
Expand Up @@ -24,7 +24,7 @@ exports.init = function (ssb, config) {
return {
latest: function () {
return pull(
ssb.createFeedStream({ live: true, old: false }),
ssb.createFeedStream({ live: true, old: false, awaitReady: false }),

ApplyFilterResult({ ssb }),
pull.filter(msg => !!msg.filterResult),
Expand All @@ -50,7 +50,7 @@ exports.init = function (ssb, config) {
var included = new Set()

// use resume option if specified
var opts = { reverse, old: true }
var opts = { reverse, old: true, awaitReady: false }
if (resume) {
opts[reverse ? 'lt' : 'gt'] = resume
}
Expand Down
1 change: 1 addition & 0 deletions sbot/thread.js
Expand Up @@ -59,6 +59,7 @@ exports.init = function (ssb, config) {
return pull(
ssb.backlinks.read({
private: true,
awaitReady: false,
reverse,
live,
old,
Expand Down

0 comments on commit 7f52d1b

Please sign in to comment.