@microlight/core 0.3.0 → 0.5.0
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/bin/microlight-core.js
CHANGED
|
@@ -5,8 +5,8 @@ import path from "path";
|
|
|
5
5
|
|
|
6
6
|
import { packageUp } from "package-up";
|
|
7
7
|
|
|
8
|
-
import { prepareTasks } from "../scripts/prepareTasks.js";
|
|
9
|
-
import { prepareServer } from "../scripts/prepareServer.js";
|
|
8
|
+
import { prepareTasks } from "../dist/scripts/prepareTasks.js";
|
|
9
|
+
import { prepareServer } from "../dist/scripts/prepareServer.js";
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -2,7 +2,7 @@ export const register = async () => {
|
|
|
2
2
|
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
3
3
|
// Dynamically import loadSchedules only when we're in Node.js runtime
|
|
4
4
|
const {
|
|
5
|
-
|
|
5
|
+
loadSchedules
|
|
6
6
|
} = await import("./lib/loadSchedules");
|
|
7
7
|
await loadSchedules();
|
|
8
8
|
// const interval = setInterval(async () => {
|
|
@@ -38,12 +38,14 @@ async function executeTask({
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
export
|
|
41
|
+
export async function loadSchedules() {
|
|
42
42
|
let schedules = [];
|
|
43
43
|
Object.keys(taskMap).forEach(function (task_slug) {
|
|
44
44
|
const task = taskMap[task_slug];
|
|
45
|
+
|
|
45
46
|
// Check if task has schedules
|
|
46
47
|
if (task.is_enabled && task.schedules && Array.isArray(task.schedules)) {
|
|
48
|
+
// console.log(task);
|
|
47
49
|
task.schedules.forEach(scheduleConfig => {
|
|
48
50
|
if (scheduleConfig.is_enabled && scheduleConfig.schedule) {
|
|
49
51
|
// Create cron job
|
|
@@ -70,7 +72,7 @@ export default async function loadSchedules() {
|
|
|
70
72
|
});
|
|
71
73
|
}
|
|
72
74
|
});
|
|
73
|
-
|
|
75
|
+
console.log('Count of schedules :' + schedules.length);
|
|
74
76
|
// console.log(schedules);
|
|
75
77
|
return schedules;
|
|
76
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microlight/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"next": "15.1.4",
|
|
36
36
|
"next-nprogress-bar": "^2.4.3",
|
|
37
37
|
"node-cron": "^3.0.3",
|
|
38
|
+
"package-up": "^5.0.0",
|
|
38
39
|
"pg": "^8.13.1",
|
|
39
40
|
"pg-hstore": "^2.3.4",
|
|
40
41
|
"react": "^19.0.0",
|