修复进程锁可能不会被正常移除的问题

pull/10/head
undefined 4 years ago
parent cb611d8f08
commit 55754b2e20

@ -20,6 +20,6 @@ jobs:
with:
name: hydro
path: .
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}

@ -23,6 +23,7 @@ export async function load(call: Entry) {
};
await fs.writeFile(lockfile, JSON.stringify(context));
global.onDestory.push(() => {
fs.removeSync(lockfile);
fs.emptyDirSync(tmpdir);
});
require('../lib/i18n');

@ -64,8 +64,7 @@ interface EntryConfig {
async function entry(config: EntryConfig) {
if (config.entry) {
if (config.newProcess) {
const sargv = [`--entry=${config.entry}`];
const p = await fork(sargv);
const p = await fork([`--entry=${config.entry}`]);
await new Promise((resolve, reject) => {
p.on('exit', (code, signal) => {
if (code === 0) resolve();

@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.10.1",
"version": "2.10.2",
"main": "dist/loader.js",
"bin": "bin/hydrooj.js",
"repository": "https://github.com/hydro-dev/Hydro.git",

Loading…
Cancel
Save