git ssb

4+

Dominic / scuttlebot



Commit 730020600eba585e4e9d9afce47283806715f12b

remove old createHistoryStreamWithSync function

Matt McKegg committed on 6/9/2017, 11:21:15 AM
Parent: 729ab87f4fa6b9e1c269a61b7e6a7c2a49041d8d

Files changed

plugins/replicate/legacy.jschanged
plugins/replicate/legacy.jsView
@@ -29,40 +29,8 @@
2929 'write EPIPE': true,
3030 'stream is closed': true, // rpc method called after stream ended
3131 }
3232
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-
6533 module.exports = function (sbot, notify, config) {
6634 var debounce = Debounce(200)
6735 var listeners = {}
6836 var newPeers = Notify()

Built with git-ssb-web