try to fix again

This commit is contained in:
2026-03-08 22:14:18 +01:00
parent 4e37e84c17
commit fc3e68bae9

View File

@@ -9,15 +9,12 @@ import { getEventStartTime } from "./utils/getEventStartTime";
import { rmSync, existsSync } from "node:fs";
import { join } from "node:path";
// remove singletonlock
const authPath = join(process.cwd(), ".wwebjs_auth");
const singletonLock = join(authPath, "SingletonLock");
const singletonCookie = join(authPath, "SingletonCookie");
const singletonSocket = join(authPath, "SingletonSocket");
for (const lockFile of [singletonLock, singletonCookie, singletonSocket]) {
if (existsSync(lockFile)) {
rmSync(lockFile, { force: true });
console.log(`[WA] removed stale lock file: ${lockFile}`);
const sessionPath = join(process.cwd(), ".wwebjs_auth", "session");
for (const name of ["SingletonLock", "SingletonCookie", "SingletonSocket"]) {
const fullPath = join(sessionPath, name);
if (existsSync(fullPath)) {
rmSync(fullPath, { force: true });
console.log(`[WA] removed stale lock file: ${fullPath}`);
}
}