mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
[project-history] add script for retrying failures (#26427)
GitOrigin-RevId: 265cec9719825613de01d7f476b20203bbff8d7f
This commit is contained in:
26
services/project-history/scripts/retry_failures.js
Executable file
26
services/project-history/scripts/retry_failures.js
Executable file
@@ -0,0 +1,26 @@
|
||||
const RetryManager = require('../app/js/RetryManager.js')
|
||||
const minimist = require('minimist')
|
||||
|
||||
const args = minimist(process.argv.slice(2), {
|
||||
string: ['failureType', 'timeout', 'limit'],
|
||||
default: {
|
||||
failureType: 'soft',
|
||||
timeout: (60 * 60 * 1000).toString(),
|
||||
limit: (100_000).toString(),
|
||||
},
|
||||
})
|
||||
|
||||
const failureType = args.failureType
|
||||
const timeout = parseInt(args.timeout, 10)
|
||||
const limit = parseInt(args.limit, 10)
|
||||
|
||||
RetryManager.retryFailures({ failureType, timeout, limit }, (err, result) => {
|
||||
if (err) {
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
} else {
|
||||
console.log(JSON.stringify(result))
|
||||
console.log('Done.')
|
||||
}
|
||||
process.exit(0)
|
||||
})
|
||||
Reference in New Issue
Block a user