qq-bot-roost 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/instance.js +10 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="零依赖">
|
|
11
11
|
<img src="https://img.shields.io/badge/tests-700%2B%20passed-brightgreen" alt="测试 700+ 项">
|
|
12
12
|
<img src="https://img.shields.io/badge/plugins-JS%20%7C%20Python%20%7C%20Go%20%7C%20any-blue" alt="多语言插件">
|
|
13
|
-
<img src="https://img.shields.io/badge/version-0.9.
|
|
13
|
+
<img src="https://img.shields.io/badge/version-0.9.3-blueviolet" alt="版本 0.9.3">
|
|
14
14
|
<img src="https://img.shields.io/badge/license-Non--Commercial-red" alt="禁止商用">
|
|
15
15
|
<a href="https://github.com/tdcq9594/qq-bot-roost/actions"><img src="https://img.shields.io/github/actions/workflow/status/tdcq9594/qq-bot-roost/ci.yml?branch=master" alt="CI"></a>
|
|
16
16
|
|
package/package.json
CHANGED
package/src/instance.js
CHANGED
|
@@ -59,7 +59,16 @@ function pidLooksLikeNode(pid) {
|
|
|
59
59
|
*/
|
|
60
60
|
if (process.platform === 'linux') {
|
|
61
61
|
const comm = readFileSync(`/proc/${pid}/comm`, 'utf8').trim();
|
|
62
|
-
|
|
62
|
+
/**
|
|
63
|
+
* 读到空字符串时**按活着算**,不是按死了算。
|
|
64
|
+
*
|
|
65
|
+
* 判断不出来的方向要选保守的那个:当成死 → 删记录 → 放行第二次认领
|
|
66
|
+
* → 同一个 AppID 双开 → 4902 互踢,正是这套机制存在的理由。
|
|
67
|
+
* 当成活 → 顶多让用户手动清一条残留记录(有 `--force`)。
|
|
68
|
+
*
|
|
69
|
+
* 真实的误判代价不对称,所以拿不准就往"活着"倒。
|
|
70
|
+
*/
|
|
71
|
+
return comm ? /node/i.test(comm) : true;
|
|
63
72
|
}
|
|
64
73
|
const comm = execFileSync('ps', ['-p', String(pid), '-o', 'comm='], {
|
|
65
74
|
encoding: 'utf8',
|