react-native-email-imap-smtp 0.3.7 → 0.3.8
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/package.json +1 -1
- package/server/bin.mjs +5 -6
package/package.json
CHANGED
package/server/bin.mjs
CHANGED
|
@@ -43,9 +43,12 @@ startEmailProxy({ port, silent, detach: !foreground }).then((handle) => {
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
//
|
|
46
|
+
// 默认模式:保持进程存活(后台由 shell 的 & 处理)
|
|
47
|
+
// Windows 上 process.exit(0) 会连带杀掉 detached 子进程,所以不再主动退出
|
|
47
48
|
if (!foreground) {
|
|
48
|
-
|
|
49
|
+
// 保持事件循环活跃(阻止进程退出,等待 stdin 关闭或 SIGTERM)
|
|
50
|
+
process.stdin.resume();
|
|
51
|
+
return;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
// 前台模式:保持进程存活,等待退出信号
|
|
@@ -55,8 +58,4 @@ startEmailProxy({ port, silent, detach: !foreground }).then((handle) => {
|
|
|
55
58
|
};
|
|
56
59
|
process.on('SIGINT', cleanup);
|
|
57
60
|
process.on('SIGTERM', cleanup);
|
|
58
|
-
|
|
59
|
-
// 保持事件循环活跃
|
|
60
|
-
const keepAlive = setInterval(() => {}, 2 ** 31 - 1);
|
|
61
|
-
process.on('exit', () => clearInterval(keepAlive));
|
|
62
61
|
});
|