You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
488 B

import { IMAP_LOCK } from "../src/services/imap/poller";
import {
isMysqlNamedLockHeld,
killMysqlNamedLockHolder,
} from "../src/services/db-lock";
async function main() {
const before = await isMysqlNamedLockHeld(IMAP_LOCK);
console.log("before", before);
if (before !== "free") {
console.log(await killMysqlNamedLockHolder(IMAP_LOCK));
}
console.log("after", await isMysqlNamedLockHeld(IMAP_LOCK));
}
main().catch((e) => {
console.error(e);
process.exit(1);
});