[feat] [demo] Using SQLite in Jobs

This commit is contained in:
gaoshuaixing
2025-03-11 16:08:42 +08:00
parent e49aa4e032
commit 4c75758fcc
2 changed files with 9 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ const { isChildJob, exit } = require('ee-core/ps');
const { childMessage } = require('ee-core/message');
const { welcome } = require('./hello');
const { UserService } = require('../../service/job/user');
const { sqlitedbService } = require('../../service/database/sqlitedb');
/**
* example - TimerJob
@@ -17,6 +18,7 @@ class TimerJob {
this.timeoutTimer = undefined;
this.number = 0;
this.countdown = 10; // 倒计时
sqlitedbService.init();
}
/**
@@ -37,6 +39,10 @@ class TimerJob {
this.number = 0;
this.countdown = 10;
this.doTimer(jobId);
// sqlite
const userList = await sqlitedbService.getAllTestDataSqlite();
logger.info('[child-process] Sqlite userList:', userList);
}
/**

View File

@@ -1,5 +1,5 @@
{
"name": "ee",
"name": "ee-next",
"version": "4.1.0",
"description": "A fast, desktop software development framework",
"main": "./public/electron/main.js",
@@ -45,7 +45,7 @@
"@types/node": "^20.16.0",
"cross-env": "^7.0.3",
"debug": "^4.4.0",
"ee-bin": "^4.1.4",
"ee-bin": "file:.yalc/ee-bin",
"electron": "^31.7.6",
"electron-builder": "^25.1.8"
},
@@ -53,7 +53,7 @@
"axios": "^1.7.9",
"better-sqlite3": "^11.7.0",
"dayjs": "^1.11.13",
"ee-core": "^4.0.1",
"ee-core": "file:.yalc/ee-core",
"electron-updater": "^6.3.8"
}
}