Fix: Rare timing issue on first-use causing duplicate naming config

pull/147/head
Qstick 7 years ago
parent b63d9d0146
commit 4525f99370

@ -19,11 +19,19 @@ namespace NzbDrone.Core.Organizer
{
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…
Cancel
Save