Update db lock cross 2 process

This commit is contained in:
2023-05-21 09:23:46 +08:00
parent 54563d1d07
commit 48b6393f9a
2 changed files with 31 additions and 1 deletions

View File

@@ -60,3 +60,14 @@ export function parse_bool(s: string) {
const l = s.toLowerCase();
return l === "true" || l === "yes";
}
export function try_remove_sync(
s: string,
o: Deno.RemoveOptions | undefined = undefined,
) {
try {
Deno.removeSync(s, o);
} catch (_) {
return;
}
}