mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-27 00:02:25 +00:00
Fix: Rare timing issue on first-use causing duplicate naming config
This commit is contained in:
parent
b63d9d0146
commit
4525f99370
1 changed files with 11 additions and 3 deletions
|
@ -19,11 +19,19 @@ public NamingConfig GetConfig()
|
|||
{
|
||||
var config = _repository.SingleOrDefault();
|
||||
|
||||
if (config == null)
|
||||
{
|
||||
lock (_repository)
|
||||
{
|
||||
config = _repository.SingleOrDefault();
|
||||
|
||||
if (config == null)
|
||||
{
|
||||
_repository.Insert(NamingConfig.Default);
|
||||
config = _repository.Single();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue