mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
Moved settings cache to an explicit "in memory" adapter
refs https://github.com/TryGhost/Toolbox/issues/364 - Before introducing an image size caching mechanism we need to make existing caches explicit - makes sure caches are operating in multiple different instances. - Explicit syntax also allows to pass in different configurations for each cache instance (e.g. use different Redis connections for caches with different purposes)
This commit is contained in:
parent
05eb719d0a
commit
34b4421452
7
ghost/core/core/server/adapters/cache/SettingsCacheSyncInMemory.js
vendored
Normal file
7
ghost/core/core/server/adapters/cache/SettingsCacheSyncInMemory.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
const Memory = require('./Memory');
|
||||
|
||||
class SettingsCacheSyncInMemory extends Memory {
|
||||
|
||||
}
|
||||
|
||||
module.exports = SettingsCacheSyncInMemory;
|
@ -67,7 +67,7 @@ module.exports = {
|
||||
* Initialize the cache, used in boot and in testing
|
||||
*/
|
||||
async init() {
|
||||
const cacheStore = adapterManager.getAdapter('cache');
|
||||
const cacheStore = adapterManager.getAdapter('cache:settings');
|
||||
const settingsCollection = await models.Settings.populateDefaults();
|
||||
SettingsCache.init(events, settingsCollection, this.getCalculatedFields(), cacheStore);
|
||||
},
|
||||
|
@ -25,7 +25,9 @@
|
||||
"active": "Default"
|
||||
},
|
||||
"cache": {
|
||||
"active": "Memory"
|
||||
"active": "Memory",
|
||||
"settings": "SettingsCacheSyncInMemory",
|
||||
"SettingsCacheSyncInMemory": {}
|
||||
}
|
||||
},
|
||||
"storage": {
|
||||
|
Loading…
Reference in New Issue
Block a user