Commit 754c2c529f956adf3d576fbd5ed319dbc2291d59
feed-summary: fix stuck windows
Matt McKegg committed on 11/2/2016, 12:31:10 AMParent: 650fccfe928ae39c6023e3e2af686943028bb9af
Files changed
lib/feed-summary.js | changed |
lib/feed-summary.js | |||
---|---|---|---|
@@ -30,9 +30,9 @@ | |||
30 | 30 … | } else { | |
31 | 31 … | var fromTime = last && last.timestamp || Date.now() | |
32 | 32 … | last = values[values.length - 1] | |
33 | 33 … | groupMessages(values, fromTime, bumpFilter, (err, result) => { | |
34 | - if (err) return cb(err) | ||
34 … | + if (err) throw err | ||
35 | 35 … | result.forEach(v => pushable.push(v)) | |
36 | 36 … | pushable.end() | |
37 | 37 … | if (!returned) cb && cb() | |
38 | 38 … | returned = true | |
@@ -123,11 +123,12 @@ | |||
123 | 123 … | var start = Date.now() | |
124 | 124 … | nextBatch() | |
125 | 125 … | ||
126 | 126 … | function nextBatch () { | |
127 | - while (i >= 0 && Date.now() - start < 10) { | ||
127 … | + while (i >= 0) { | ||
128 | 128 … | fn(items[i], i) | |
129 | 129 … | i -= 1 | |
130 … | + if (Date.now() - start < 10) break | ||
130 | 131 … | } | |
131 | 132 … | ||
132 | 133 … | if (i > 0) { | |
133 | 134 … | setImmediate(nextBatch) |
Built with git-ssb-web