mirror of
https://github.com/gurnec/removeddit.git
synced 2026-03-11 08:54:27 +00:00
Small update to c236bf3
This probably isn't fixing a bug, but better safe than sorry.
This commit is contained in:
parent
6c83b19767
commit
1b156c5f56
1 changed files with 4 additions and 10 deletions
|
|
@ -35,9 +35,8 @@ class ChunkedQueue {
|
|||
this._chunks.push([x])
|
||||
}
|
||||
|
||||
hasFullChunk() {
|
||||
return this._chunks[0].length >= this._chunkSize
|
||||
}
|
||||
hasFullChunk = () => this._chunks[0].length >= this._chunkSize
|
||||
isEmpty = () => this._chunks[0].length == 0
|
||||
|
||||
shiftChunk() {
|
||||
const first = this._chunks.shift()
|
||||
|
|
@ -45,12 +44,6 @@ class ChunkedQueue {
|
|||
this._chunks.push([])
|
||||
return first
|
||||
}
|
||||
|
||||
shiftAll() {
|
||||
const all = this._chunks.flat()
|
||||
this._chunks = [[]]
|
||||
return all
|
||||
}
|
||||
}
|
||||
|
||||
class Thread extends React.Component {
|
||||
|
|
@ -217,7 +210,8 @@ class Thread extends React.Component {
|
|||
console.log('Pushshift:', lengths.reduce((a,b) => a+b, 0), 'comments')
|
||||
|
||||
// All comments from Pushshift have been processed; wait for Reddit to finish
|
||||
doRedditComments(redditIdQueue.shiftAll())
|
||||
while (!redditIdQueue.isEmpty())
|
||||
doRedditComments(redditIdQueue.shiftChunk())
|
||||
Promise.all(redditPromises).then(lengths => {
|
||||
console.log('Reddit:', lengths.reduce((a,b) => a+b, 0), 'comments')
|
||||
if (!redditError) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue