print "running as service" on Windows
Massimo Melina committed
Nov 7, 2024 at 18:26 UTC
1393b925ef2052d75a5b2f5cfab86ca93b2fd9db
1 file changed
+5
-1
src/util-os.ts
+5
-1
@@ -80,7 +80,11 @@ async function getWindowsServicePids() {
80
return _.uniq(res.split('\n').slice(1).map(x => Number(x.trim())))
81
}
82
83
-export const RUNNING_AS_SERVICE = IS_WINDOWS && getWindowsServicePids().then(x => x.includes(pid), e => {
83
+export const RUNNING_AS_SERVICE = IS_WINDOWS && getWindowsServicePids().then(x => {
84
+ const ret = x.includes(pid)
85
+ if (ret) console.log("running as service")
86
+ return ret
87
+}, e => {
88
console.log("couldn't determine if we are running as a service")
89
console.debug(e)
90
})