Dispose config managers ahead of time to avoid database errors

This commit is contained in:
Dean Herbert 2019-09-06 00:22:35 +09:00
parent 9d0151f19f
commit dafe9da851
1 changed files with 8 additions and 0 deletions

View File

@ -36,5 +36,13 @@ public IRulesetConfigManager GetConfigFor(Ruleset ruleset)
return configCache.GetOrAdd(ruleset.RulesetInfo.ID.Value, _ => ruleset.CreateConfig(settingsStore));
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
foreach (var c in configCache.Values)
(c as IDisposable)?.Dispose();
}
}
}