aboutsummaryrefslogtreecommitdiff
path: root/src/lib/config.js
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-03-27 16:57:05 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-03-27 16:57:05 +0300
commit0327f8962fbf42c4f113cb7f8fbc5f462d2ec13b (patch)
treeb697b5821dbce3798b4abbaa862c2343fab2a197 /src/lib/config.js
parent832055d922032544439f204198e78e4fe7ca5c45 (diff)
jobd: support launcher environment settings
Diffstat (limited to 'src/lib/config.js')
-rw-r--r--src/lib/config.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/config.js b/src/lib/config.js
index 289a79f..f3a9e61 100644
--- a/src/lib/config.js
+++ b/src/lib/config.js
@@ -49,6 +49,14 @@ function processScheme(source, scheme) {
value = !!value
}
break
+
+ case 'map':
+ value = {}
+ for (let key1 in source) {
+ if (key1.startsWith(`${key}.`))
+ value[key1.substring(key.length+1)] = source[key1]
+ }
+ break
}
}
@@ -85,6 +93,8 @@ function parseWorkerConfig(file) {
mysql_fetch_limit: {default: 100, type: 'int'},
launcher: {required: true},
+ 'launcher.cwd': {default: process.cwd()},
+ 'launcher.env': {type: 'map', default: {}},
max_output_buffer: {default: 1024*1024, type: 'int'},
targets: {required: true, type: 'object'},
}