Commit 730020600eba585e4e9d9afce47283806715f12b
remove old createHistoryStreamWithSync function
Matt McKegg committed on 6/9/2017, 11:21:15 AMParent: 729ab87f4fa6b9e1c269a61b7e6a7c2a49041d8d
Files changed
plugins/replicate/legacy.js | changed |
plugins/replicate/legacy.js | ||
---|---|---|
@@ -29,40 +29,8 @@ | ||
29 | 29 | 'write EPIPE': true, |
30 | 30 | 'stream is closed': true, // rpc method called after stream ended |
31 | 31 | } |
32 | 32 | |
33 | -function createHistoryStreamWithSync (rpc, upto, onSync) { | |
34 | - // HACK: createHistoryStream does not emit sync event, so we don't | |
35 | - // know when it switches to live. Do it manually! | |
36 | - var last = (upto.sequence || upto.seq || 0) | |
37 | - var state = null | |
38 | - return pullNext(function () { | |
39 | - if (!state) { | |
40 | - state = 'old' | |
41 | - return pull( | |
42 | - rpc.createHistoryStream({ | |
43 | - id: upto.id, | |
44 | - seq: last + 1, | |
45 | - live: false, | |
46 | - keys: false | |
47 | - }), | |
48 | - pull.through(msg => { | |
49 | - last = Math.max(last, msg.sequence) | |
50 | - }) | |
51 | - ) | |
52 | - } else if (state === 'old') { | |
53 | - state = 'sync' | |
54 | - onSync && onSync(true) | |
55 | - return rpc.createHistoryStream({ | |
56 | - id: upto.id, | |
57 | - seq: last + 1, | |
58 | - live: true, | |
59 | - keys: false | |
60 | - }) | |
61 | - } | |
62 | - }) | |
63 | -} | |
64 | - | |
65 | 33 | module.exports = function (sbot, notify, config) { |
66 | 34 | var debounce = Debounce(200) |
67 | 35 | var listeners = {} |
68 | 36 | var newPeers = Notify() |
Built with git-ssb-web