项目自启动服务
This commit is contained in:
parent
597052515c
commit
c0e3af63c1
|
|
@ -1,5 +1,11 @@
|
||||||
// invoked in worker
|
// invoked in worker
|
||||||
|
const { execSync } = require('child_process');
|
||||||
think.beforeStartServer(async () => {
|
think.beforeStartServer(async () => {
|
||||||
|
try {
|
||||||
|
execSync('service mysql start', { stdio: ['inherit', 'inherit', 'inherit'] });
|
||||||
|
} catch (error) {
|
||||||
|
console.log("beforeStartServer", error);
|
||||||
|
}
|
||||||
const username = 'test';
|
const username = 'test';
|
||||||
let user = await think.model("users").where({ username }).find();
|
let user = await think.model("users").where({ username }).find();
|
||||||
if (think.isEmpty(user)) {
|
if (think.isEmpty(user)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue