mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-26 03:44:44 +01:00
20 lines
453 B
JavaScript
20 lines
453 B
JavaScript
module.exports = function (query, force) {
|
|
var isAttached = false
|
|
if (process.stderr.isTTY || force === true) {
|
|
isAttached = true
|
|
process.on('SIGINFO', onsiginfo)
|
|
process.on('SIGUSR1', onsiginfo)
|
|
}
|
|
|
|
return function () {
|
|
if (isAttached === true) {
|
|
process.removeListener('SIGINFO', onsiginfo)
|
|
process.removeListener('SIGUSR1', onsiginfo)
|
|
isAttached = false
|
|
}
|
|
}
|
|
|
|
function onsiginfo () {
|
|
query()
|
|
}
|
|
}
|