After updates
This commit is contained in:
@@ -115,6 +115,20 @@ CREATE TABLE IF NOT EXISTS scan_history (
|
||||
error_message TEXT DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table: scanner_lock
|
||||
-- Single-instance guard for the directory scanner. Ensures only one scan
|
||||
-- runs at a time across all replicas. A lease (locked_at + lease_seconds)
|
||||
-- lets a live scanner keep the lock via heartbeats, and lets a crashed
|
||||
-- scanner's lock be taken over once it goes stale.
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS scanner_lock (
|
||||
lock_name VARCHAR(64) PRIMARY KEY,
|
||||
owner VARCHAR(128) NOT NULL COMMENT 'Instance id (host-pid-uuid) holding the lock',
|
||||
locked_at DATETIME NOT NULL COMMENT 'Last time the lock was acquired or heartbeated',
|
||||
lease_seconds INT NOT NULL DEFAULT 21600 COMMENT 'Lock is stale if older than this (6 hours)'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Insert default model entry
|
||||
-- -----------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user