diff --git a/api/src/api/v2.js b/api/src/api/v2.js index d772c5a..c0526f4 100644 --- a/api/src/api/v2.js +++ b/api/src/api/v2.js @@ -106,11 +106,11 @@ function get_job(body) { }); } - for (let constraint of ['memory_limit', 'timeout']) { - for (let type of ['compile', 'run']) { - let constraint_name = `${type}_${constraint}`; - let constraint_value = body[constraint_name]; - let configured_limit = rt[`${constraint}s`][type]; + for (const constraint of ['memory_limit', 'timeout']) { + for (const type of ['compile', 'run']) { + const constraint_name = `${type}_${constraint}`; + const constraint_value = body[constraint_name]; + const configured_limit = rt[`${constraint}s`][type]; if (!constraint_value) { continue; } diff --git a/api/src/config.js b/api/src/config.js index 8d0020f..85aa691 100644 --- a/api/src/config.js +++ b/api/src/config.js @@ -11,8 +11,8 @@ function parse_overrides(overrides) { } function validate_overrides(overrides, options) { - for (let language in overrides) { - for (let key in overrides[language]) { + for (const language in overrides) { + for (const key in overrides[language]) { if ( ![ 'max_process_count', @@ -28,13 +28,13 @@ function validate_overrides(overrides, options) { logger.error(`Invalid overridden option: ${key}`); return false; } - let option = options.find(o => o.key === key); - let parser = option.parser; - let raw = overrides[language][key]; - let value = parser(raw); - let validators = option.validators; - for (let validator of validators) { - let response = validator(value, raw); + const option = options.find(o => o.key === key); + const parser = option.parser; + const raw = overrides[language][key]; + const value = parser(raw); + const validators = option.validators; + for (const validator of validators) { + const response = validator(value, raw); if (response !== true) { logger.error( `Failed to validate overridden option: ${key}`,