2020-02-19 06:14:28 -05:00
|
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
|
|
// Sanity-check the conversion and remove this comment.
|
2020-02-19 06:14:14 -05:00
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
2020-02-19 06:14:37 -05:00
|
|
|
const async = require('async')
|
2021-07-12 12:47:21 -04:00
|
|
|
const Settings = require('@overleaf/settings')
|
2022-03-01 10:09:36 -05:00
|
|
|
const logger = require('@overleaf/logger')
|
2020-02-19 06:14:37 -05:00
|
|
|
const queue = async.queue(
|
|
|
|
(task, cb) => task(cb),
|
|
|
|
Settings.parallelSqlQueryLimit
|
|
|
|
)
|
2018-07-30 11:46:47 -04:00
|
|
|
|
2020-02-19 06:14:37 -05:00
|
|
|
queue.drain = () => logger.debug('all items have been processed')
|
2018-07-30 11:46:47 -04:00
|
|
|
|
2020-02-19 06:14:37 -05:00
|
|
|
module.exports = { queue }
|