mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-31 03:11:07 +02:00
Rare timing issue on first-use causing duplicate naming config.
This commit is contained in:
parent
4ca5e978ac
commit
0553a39a02
@ -21,8 +21,16 @@ public NamingConfig GetConfig()
|
||||
|
||||
if (config == null)
|
||||
{
|
||||
_repository.Insert(NamingConfig.Default);
|
||||
config = _repository.Single();
|
||||
lock (_repository)
|
||||
{
|
||||
config = _repository.SingleOrDefault();
|
||||
|
||||
if (config == null)
|
||||
{
|
||||
_repository.Insert(NamingConfig.Default);
|
||||
config = _repository.Single();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
@ -33,4 +41,4 @@ public void Save(NamingConfig namingConfig)
|
||||
_repository.Upsert(namingConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user