Skip to content

Commit 0d7a2a5

Browse files
committed
- fix resolving local config in the debug mode
1 parent 81a410b commit 0d7a2a5

File tree

6 files changed

+22
-38
lines changed

6 files changed

+22
-38
lines changed

bin/coderunner.json

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,8 @@
11
{
2-
"managementHttpPort": null,
3-
"workers": {
4-
"cache": {
5-
"limit": 20
6-
},
7-
"concurrent": 4,
8-
"minIdle": 2,
9-
"heartbeat": {
10-
"interval": 5,
11-
"timeout": 10
12-
},
13-
"lowPriorityThreshold": 0.8
14-
},
15-
"deploy": {
16-
"progressInterval": 500
17-
},
182
"backendless": {
19-
"forwardableHeaders": "",
203
"msgBroker": {
214
"host": "cl.backendless.com",
22-
"port": 6379,
23-
"max_attempts": 5
5+
"port": 6379
246
}
257
},
268
"app": {
@@ -32,13 +14,5 @@
3214
"node_modules/**",
3315
"examples/services/wsdl-proxy/**"
3416
]
35-
},
36-
"loggers": {
37-
"file": false,
38-
"workers": true,
39-
"managementServer": false
40-
},
41-
"sandbox": true,
42-
"verbose": false,
43-
"debug": false
17+
}
4418
}

lib/cli/file.js renamed to lib/cli/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const logger = require('../util/logger')
66

77
const CONFIG_FILE = './coderunner.json'
88

9-
module.exports = function getOptionsFromConfigurationFile(file) {
9+
module.exports = function getAppOptions(file) {
1010
const options = readFile(file)
1111

1212
if (typeof options.workers === 'number') {

lib/cli/defaults.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2+
"managementHttpPort": null,
23
"workers": {
4+
"lowPriorityThreshold": 0.8,
35
"cache": false,
46
"concurrent": 4,
57
"minIdle": 4,
@@ -36,13 +38,16 @@
3638
},
3739
"sandbox": false,
3840
"verbose": false,
41+
"debug": false,
3942
"compression": {
4043
"debug": false,
4144
"prod": false,
4245
"cloud": false,
4346
"threshold": 8192
4447
},
4548
"loggers": {
49+
"workers": true,
50+
"managementServer": false,
4651
"console": true,
4752
"file": false,
4853
"backendless": true,

lib/cli/options.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@
55
module.exports = async function getRunOptions(appRequired, repoPathRequired) {
66
const { program } = require('commander')
77

8-
const getOptionsFromConfigurationFile = require('./file')
98
const enrichWithENV = require('./env')
109
const enrichWithProgramArguments = require('./program')
1110

12-
const options = await getOptionsFromConfigurationFile(program.opts().config)
13-
14-
const { initConfig } = require('backendless-js-services-core/lib/config')
11+
const { initConfig, mergeConfigs } = require('backendless-js-services-core/lib/config')
1512

1613
return await initConfig({
1714
defaults: require('./defaults.json'),
18-
config : options,
15+
config : {},
1916
consul : {
2017
serviceKey: 'config/coderunner/js/',
2118
extraKeys : require('./consul.json'),
@@ -24,6 +21,14 @@ module.exports = async function getRunOptions(appRequired, repoPathRequired) {
2421

2522
normalizeBasicConfigs(config)
2623

24+
if (appRequired) {
25+
const getAppOptions = require('./app')
26+
27+
const appConfig = await getAppOptions(program.opts().config)
28+
29+
mergeConfigs(config, appConfig)
30+
}
31+
2732
enrichWithENV(config)
2833

2934
await enrichWithProgramArguments(config, appRequired, repoPathRequired)

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
],
3737
"dependencies": {
3838
"backendless": "^6.7.0",
39-
"backendless-js-services-core": "^0.0.18",
39+
"backendless-js-services-core": "^0.0.19",
4040
"commander": "^8.3.0",
4141
"glob": "^7.2.0",
4242
"jsdoc": "^3.6.10",

0 commit comments

Comments
 (0)