Skip to content

Commit

Permalink
doc: add method queue doc
Browse files Browse the repository at this point in the history
  • Loading branch information
geolffreym committed Mar 24, 2022
1 parent 147cd4d commit eebd60a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/core/ingest.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ module.exports = class Ingest extends EventEmitter {
this.asyncLock = false
}


/**
* Add to queue hash to process
* @param {string} hash
*/
set queue (hash) {
log.info('Storing hash in queue')
const cache = key.readFromStorage()
const cacheList = cache.hash ?? []
// Deduplication with sets
// Deduplicate with sets
const newHash = [...new Set([...cacheList, ...[hash]])]
key.addToStorage({ hash: newHash })
}
Expand Down

0 comments on commit eebd60a

Please sign in to comment.