// // Copyright (c) PlaceholderCompany. All rights reserved. // namespace Jellyfin.Server.Implementations.Clustering { using System; /// /// Standard lock names for distributed locking. /// public static class DistributedLockNames { /// /// Lock for database migrations. /// public const string DatabaseMigration = "database:migration"; /// /// Lock for primary instance election. /// public const string PrimaryElection = "instance:primary:election"; /// /// Global lock for all library scans. /// public const string GlobalLibraryScan = "library:scan:global"; /// /// Lock for library scanning operations. /// /// The library ID. /// The lock name. public static string LibraryScan(Guid libraryId) { return $"library:scan:{libraryId}"; } /// /// Lock for metadata refresh operations. /// /// The item ID. /// The lock name. public static string MetadataRefresh(Guid itemId) { return $"metadata:refresh:{itemId}"; } /// /// Lock for configuration updates. /// /// The configuration type. /// The lock name. public static string ConfigurationUpdate(string configType) { return $"config:update:{configType}"; } /// /// Lock for scheduled task execution. /// /// The task name. /// The lock name. public static string ScheduledTask(string taskName) { return $"task:{taskName}"; } /// /// Lock for image processing operations. /// /// The item ID. /// The lock name. public static string ImageProcessing(Guid itemId) { return $"image:process:{itemId}"; } /// /// Lock for cache clearing operations. /// /// The cache type. /// The lock name. public static string CacheClear(string cacheType) { return $"cache:clear:{cacheType}"; } /// /// Lock for plugin operations. /// /// The plugin ID. /// The lock name. public static string PluginOperation(Guid pluginId) { return $"plugin:operation:{pluginId}"; } } }