Added cache reload button to admin panel so restarts are needed less often.
This commit is contained in:
12
src/cache.js
12
src/cache.js
@@ -1,5 +1,9 @@
|
||||
import redis from './redis.js';
|
||||
|
||||
import { cacheTagIds } from './tags.js';
|
||||
import { cacheEntityIds } from './entities.js';
|
||||
import { cacheCampaigns } from './campaigns.js';
|
||||
|
||||
export async function getIdsBySlug(slugs, domain, toMap) {
|
||||
if (!slugs) {
|
||||
return [];
|
||||
@@ -25,3 +29,11 @@ export async function getIdsBySlug(slugs, domain, toMap) {
|
||||
|
||||
return ids.filter(Boolean);
|
||||
}
|
||||
|
||||
export async function initCaches() {
|
||||
await Promise.all([
|
||||
cacheTagIds(),
|
||||
cacheEntityIds(),
|
||||
cacheCampaigns(),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user