process-rerun
Version:
The purpose of this library is - build simple and flexible interface for parallel command execution with rerun (on fail) possibility
24 lines • 904 B
JavaScript
import { logger } from './logger';
import { getPollTime } from './helpers';
import { circleExecutor } from './executor.circle';
import { intimeExecutor } from './executor.intime';
function reRunnerBuilder(runOptions) {
const { logLevel = 'ERROR', intime = false, ...executorOptions } = runOptions;
logger.setLogLevel(logLevel);
return intime
? intimeExecutor.bind(null, executorOptions)
: circleExecutor.bind(null, executorOptions);
}
const getReruner = ({ maxThreads = 5, attemptsCount = 2, longestProcessTime = 450_000, pollTime = 1000, successExitCode = 0, ...rest } = {}) => {
const reformattedArgs = {
longestProcessTime,
maxThreads,
attemptsCount,
successExitCode,
pollTime: getPollTime(pollTime),
...rest,
};
return reRunnerBuilder(reformattedArgs);
};
export { getReruner };
//# sourceMappingURL=index.js.map