mirror of
https://github.com/docmost/docmost.git
synced 2026-05-25 12:04:35 +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
|
LANGUAGE plpgsql
|
||||||
AS $$
|
AS $$
|
||||||
BEGIN
|
BEGIN
|
||||||
|
IF NOT pg_try_advisory_xact_lock(hashtext('rebuild_page_hierarchy')) THEN
|
||||||
|
RETURN;
|
||||||
|
END IF;
|
||||||
|
|
||||||
TRUNCATE page_hierarchy;
|
TRUNCATE page_hierarchy;
|
||||||
|
|
||||||
WITH RECURSIVE page_tree AS (
|
WITH RECURSIVE page_tree AS (
|
||||||
|
|||||||
Reference in New Issue
Block a user