mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 23:05:18 -07:00
Rare timing issue on first-use causing duplicate naming config.
This commit is contained in:
parent
4ca5e978ac
commit
0553a39a02
1 changed files with 11 additions and 3 deletions
|
@ -19,11 +19,19 @@ namespace NzbDrone.Core.Organizer
|
||||||
{
|
{
|
||||||
var config = _repository.SingleOrDefault();
|
var config = _repository.SingleOrDefault();
|
||||||
|
|
||||||
|
if (config == null)
|
||||||
|
{
|
||||||
|
lock (_repository)
|
||||||
|
{
|
||||||
|
config = _repository.SingleOrDefault();
|
||||||
|
|
||||||
if (config == null)
|
if (config == null)
|
||||||
{
|
{
|
||||||
_repository.Insert(NamingConfig.Default);
|
_repository.Insert(NamingConfig.Default);
|
||||||
config = _repository.Single();
|
config = _repository.Single();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue