update
This commit is contained in:
parent
c77bf01a08
commit
14d976a12d
|
|
@ -1,11 +1,15 @@
|
||||||
// invoked in worker
|
// invoked in worker
|
||||||
const { execSync } = require('child_process');
|
const { execSync } = require('child_process');
|
||||||
|
const os = require("os");
|
||||||
think.beforeStartServer(async () => {
|
think.beforeStartServer(async () => {
|
||||||
|
if (os.platform().startsWith("linux")) {
|
||||||
try {
|
try {
|
||||||
execSync('service mysql start', { stdio: ['inherit', 'inherit', 'inherit'] });
|
execSync('service mysql start', { stdio: ['inherit', 'inherit', 'inherit'] });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("beforeStartServer", 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