mirror of
https://github.com/docmost/docmost.git
synced 2026-05-10 00:13:36 +08:00
lock during rebuild
This commit is contained in:
@@ -46,6 +46,10 @@ export async function up(db: Kysely<any>): Promise<void> {
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
BEGIN
|
||||
IF NOT pg_try_advisory_xact_lock(hashtext('rebuild_page_hierarchy')) THEN
|
||||
RETURN;
|
||||
END IF;
|
||||
|
||||
TRUNCATE page_hierarchy;
|
||||
|
||||
WITH RECURSIVE page_tree AS (
|
||||
|
||||
Reference in New Issue
Block a user