mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-06 13:02:23 -07: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
|
@ -21,8 +21,16 @@ namespace NzbDrone.Core.Organizer
|
||||||
|
|
||||||
if (config == null)
|
if (config == null)
|
||||||
{
|
{
|
||||||
_repository.Insert(NamingConfig.Default);
|
lock (_repository)
|
||||||
config = _repository.Single();
|
{
|
||||||
|
config = _repository.SingleOrDefault();
|
||||||
|
|
||||||
|
if (config == null)
|
||||||
|
{
|
||||||
|
_repository.Insert(NamingConfig.Default);
|
||||||
|
config = _repository.Single();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
|
@ -33,4 +41,4 @@ namespace NzbDrone.Core.Organizer
|
||||||
_repository.Upsert(namingConfig);
|
_repository.Upsert(namingConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue