@nattyjs/core 0.0.1-beta.48 → 0.0.1-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +19 -12
- package/dist/index.mjs +19 -12
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -122,29 +122,36 @@ const nattyContainer = new class {
|
|
|
122
122
|
}
|
|
123
123
|
}();
|
|
124
124
|
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const result = initializeModule(config);
|
|
131
|
-
callLifeCycleEvents(config);
|
|
132
|
-
startWebSchedule(config);
|
|
133
|
-
return result;
|
|
125
|
+
function startWebSchedules(schedules) {
|
|
126
|
+
if (schedules && Array.isArray(schedules)) {
|
|
127
|
+
for (const schedule of schedules)
|
|
128
|
+
startWebSchedule(schedule);
|
|
129
|
+
}
|
|
134
130
|
}
|
|
135
131
|
async function startWebSchedule(config) {
|
|
136
|
-
if (config
|
|
132
|
+
if (config) {
|
|
137
133
|
const interval = setInterval(async () => {
|
|
138
134
|
try {
|
|
139
135
|
clearInterval(interval);
|
|
140
|
-
await config.
|
|
136
|
+
await config.scheduleFunction();
|
|
141
137
|
startWebSchedule(config);
|
|
142
138
|
} catch (ex) {
|
|
143
139
|
startWebSchedule(config);
|
|
144
140
|
}
|
|
145
|
-
}, config.
|
|
141
|
+
}, config.interval);
|
|
146
142
|
}
|
|
147
143
|
}
|
|
144
|
+
|
|
145
|
+
function init(config, appConfig) {
|
|
146
|
+
common.commonContainer.setupConfig(config);
|
|
147
|
+
common.commonContainer.setEnvTsDefinition(appConfig.envTsDefinition);
|
|
148
|
+
nattyContainer.setup(config, appConfig.routes, appConfig.resolver);
|
|
149
|
+
callLifeCycleEvents(config, true);
|
|
150
|
+
const result = initializeModule(config);
|
|
151
|
+
callLifeCycleEvents(config);
|
|
152
|
+
startWebSchedules(config.webSchedules);
|
|
153
|
+
return result;
|
|
154
|
+
}
|
|
148
155
|
function initializeModule(config) {
|
|
149
156
|
if (config.app) {
|
|
150
157
|
return config.app.init(config);
|
package/dist/index.mjs
CHANGED
|
@@ -120,29 +120,36 @@ const nattyContainer = new class {
|
|
|
120
120
|
}
|
|
121
121
|
}();
|
|
122
122
|
|
|
123
|
-
function
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const result = initializeModule(config);
|
|
129
|
-
callLifeCycleEvents(config);
|
|
130
|
-
startWebSchedule(config);
|
|
131
|
-
return result;
|
|
123
|
+
function startWebSchedules(schedules) {
|
|
124
|
+
if (schedules && Array.isArray(schedules)) {
|
|
125
|
+
for (const schedule of schedules)
|
|
126
|
+
startWebSchedule(schedule);
|
|
127
|
+
}
|
|
132
128
|
}
|
|
133
129
|
async function startWebSchedule(config) {
|
|
134
|
-
if (config
|
|
130
|
+
if (config) {
|
|
135
131
|
const interval = setInterval(async () => {
|
|
136
132
|
try {
|
|
137
133
|
clearInterval(interval);
|
|
138
|
-
await config.
|
|
134
|
+
await config.scheduleFunction();
|
|
139
135
|
startWebSchedule(config);
|
|
140
136
|
} catch (ex) {
|
|
141
137
|
startWebSchedule(config);
|
|
142
138
|
}
|
|
143
|
-
}, config.
|
|
139
|
+
}, config.interval);
|
|
144
140
|
}
|
|
145
141
|
}
|
|
142
|
+
|
|
143
|
+
function init(config, appConfig) {
|
|
144
|
+
commonContainer.setupConfig(config);
|
|
145
|
+
commonContainer.setEnvTsDefinition(appConfig.envTsDefinition);
|
|
146
|
+
nattyContainer.setup(config, appConfig.routes, appConfig.resolver);
|
|
147
|
+
callLifeCycleEvents(config, true);
|
|
148
|
+
const result = initializeModule(config);
|
|
149
|
+
callLifeCycleEvents(config);
|
|
150
|
+
startWebSchedules(config.webSchedules);
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
146
153
|
function initializeModule(config) {
|
|
147
154
|
if (config.app) {
|
|
148
155
|
return config.app.init(config);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nattyjs/core",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.49",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "ajayojha",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"reflect-metadata": "0.2.2",
|
|
19
19
|
"tsyringe": "^4.7.0",
|
|
20
20
|
"path-to-regexp": "6.2.1",
|
|
21
|
-
"@nattyjs/common": "0.0.1-beta.
|
|
21
|
+
"@nattyjs/common": "0.0.1-beta.49"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"unbuild": "1.2.1"
|