mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Fixed bug in Azure cache providers (endless tenant restart).
This commit is contained in:
parent
c163d87902
commit
5bb2ff2f78
@ -19,14 +19,22 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
: base() {
|
||||
|
||||
// Create default configuration to local role-based cache when feature is enabled.
|
||||
if (!shellSettings.Keys.Contains(Constants.DatabaseCacheHostIdentifierSettingName))
|
||||
var doSave = false;
|
||||
if (!shellSettings.Keys.Contains(Constants.DatabaseCacheHostIdentifierSettingName)) {
|
||||
shellSettings[Constants.DatabaseCacheHostIdentifierSettingName] = "Orchard.Azure.Web";
|
||||
if (!shellSettings.Keys.Contains(Constants.DatabaseCacheCacheNameSettingName))
|
||||
doSave = true;
|
||||
}
|
||||
if (!shellSettings.Keys.Contains(Constants.DatabaseCacheCacheNameSettingName)) {
|
||||
shellSettings[Constants.DatabaseCacheCacheNameSettingName] = "DatabaseCache";
|
||||
if (!shellSettings.Keys.Contains(Constants.DatabaseCacheIsSharedCachingSettingName))
|
||||
doSave = true;
|
||||
}
|
||||
if (!shellSettings.Keys.Contains(Constants.DatabaseCacheIsSharedCachingSettingName)) {
|
||||
shellSettings[Constants.DatabaseCacheIsSharedCachingSettingName] = "false";
|
||||
doSave = true;
|
||||
}
|
||||
|
||||
shellSettingsManager.SaveSettings(shellSettings);
|
||||
if (doSave)
|
||||
shellSettingsManager.SaveSettings(shellSettings);
|
||||
|
||||
CacheHostIdentifier = shellSettings[Constants.DatabaseCacheHostIdentifierSettingName];
|
||||
CacheName = shellSettings[Constants.DatabaseCacheCacheNameSettingName];
|
||||
|
@ -18,14 +18,22 @@ namespace Orchard.Azure.Services.Caching.Output {
|
||||
: base() {
|
||||
|
||||
// Create default configuration to local role-based cache when feature is enabled.
|
||||
if (!shellSettings.Keys.Contains(Constants.OutputCacheHostIdentifierSettingName))
|
||||
var doSave = false;
|
||||
if (!shellSettings.Keys.Contains(Constants.OutputCacheHostIdentifierSettingName)) {
|
||||
shellSettings[Constants.OutputCacheHostIdentifierSettingName] = "Orchard.Azure.Web";
|
||||
if (!shellSettings.Keys.Contains(Constants.OutputCacheCacheNameSettingName))
|
||||
doSave = true;
|
||||
}
|
||||
if (!shellSettings.Keys.Contains(Constants.OutputCacheCacheNameSettingName)) {
|
||||
shellSettings[Constants.OutputCacheCacheNameSettingName] = "OutputCache";
|
||||
if (!shellSettings.Keys.Contains(Constants.OutputCacheIsSharedCachingSettingName))
|
||||
doSave = true;
|
||||
}
|
||||
if (!shellSettings.Keys.Contains(Constants.OutputCacheIsSharedCachingSettingName)) {
|
||||
shellSettings[Constants.OutputCacheIsSharedCachingSettingName] = "false";
|
||||
doSave = true;
|
||||
}
|
||||
|
||||
shellSettingsManager.SaveSettings(shellSettings);
|
||||
if (doSave)
|
||||
shellSettingsManager.SaveSettings(shellSettings);
|
||||
|
||||
var cacheHostIdentifier = shellSettings[Constants.OutputCacheHostIdentifierSettingName];
|
||||
var cacheName = shellSettings[Constants.OutputCacheCacheNameSettingName];
|
||||
|
Loading…
Reference in New Issue
Block a user