blun-king-cli 9.1.655 → 9.1.657
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/LIESMICH.txt +1 -1
- package/README.md +1 -1
- package/blun.mjs +817 -231
- package/package.json +1 -1
- package/telegram-plugin/dist/console-control.mjs +2 -1
- package/worker-host.mjs +204 -68
package/package.json
CHANGED
|
@@ -291,6 +291,7 @@ export function setGrammyErrorType(type) { isGrammyError = error => error instan
|
|
|
291
291
|
const BINDING_FILE = 'tui-session-control.json';
|
|
292
292
|
const BINDING_TTL_MS = 90_000;
|
|
293
293
|
const BINDING_REFRESH_MS = 10_000;
|
|
294
|
+
const LEASE_CLOCK_SKEW_MS = 5_000;
|
|
294
295
|
const BOT_ID = /^[1-9]\d{0,18}$/u;
|
|
295
296
|
|
|
296
297
|
function underLease(dir, owner, pid) {
|
|
@@ -301,7 +302,7 @@ function underLease(dir, owner, pid) {
|
|
|
301
302
|
try {
|
|
302
303
|
const named = lstatSync(file);
|
|
303
304
|
const age = Date.now() - Math.floor(named.mtimeMs);
|
|
304
|
-
if (!named.isFile() || named.nlink !== 1 || named.size > 16 || age <
|
|
305
|
+
if (!named.isFile() || named.nlink !== 1 || named.size > 16 || age < -LEASE_CLOCK_SKEW_MS || age >= BINDING_TTL_MS) return false;
|
|
305
306
|
fd = openSync(file, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0));
|
|
306
307
|
const info = fstatSync(fd);
|
|
307
308
|
if (info.dev !== named.dev || info.ino !== named.ino || info.nlink !== 1 || !info.isFile()) return false;
|