Skip to content

Commit

Permalink
perf: update zx to v8
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Apr 6, 2024
1 parent 959ba03 commit b2fa177
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@qiwi/deep-proxy": "^3.0.0",
"@types/ip": "^1.1.3",
"@types/node": "^20.11.30",
"@types/node": "^20.12.5",
"@types/semver": "^7.5.8",
"globby-cp": "^1.3.0",
"ini": "^4.1.2",
Expand All @@ -50,7 +50,7 @@
"semver": "^7.6.0",
"ssri": "^10.0.5",
"tempy": "^3.1.0",
"zx": "7.2.3-dev.0844b88"
"zx": "8.0.0"
},
"devDependencies": {
"c8": "^9.1.0"
Expand Down
16 changes: 13 additions & 3 deletions src/test/js/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
fs,
path,
SSRI,
INI
INI,
ps,
} from '../../main/js/index.mjs'

// $.verbose
Expand Down Expand Up @@ -109,14 +110,23 @@ password = dbpassword
{
const SIGNAL = 'SIGTERM'
const nothrow = createHook({nothrow: true}, 'nothrow')
const quiet = createHook({ verbose: 0 }, 'quiet')
const quiet = createHook({ verbose: 0, quiet: true }, 'quiet')
const debug = createHook({ verbose: 2 }, 'debug')
const timeout = createHook(
null,
'timeout',
(p, t, signal) => {
if (!t) return p
let timer = setTimeout(() => p.kill(signal), t)
let timer = setTimeout(() => {
(async () => {
const list = await ps.tree({ pid: p.child.pid, recursive: true })
for (const l of list) {
process.kill(+l.pid)
}
process.kill(+p.child.pid, signal)
})()
// p.kill(signal)
}, t)

p.finally(() => clearTimeout(timer))

Expand Down

0 comments on commit b2fa177

Please sign in to comment.