mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: domain: update cache for getByHost
This commit is contained in:
1 file changed
+6
-1
@@ -295,7 +295,12 @@ bus.on('ready', () => Promise.all([
|
|||||||
{ key: { domainId: 1, rp: -1, uid: 1 }, name: 'rp', sparse: true },
|
{ key: { domainId: 1, rp: -1, uid: 1 }, name: 'rp', sparse: true },
|
||||||
),
|
),
|
||||||
]));
|
]));
|
||||||
bus.on('domain/delete-cache', (domainId: string) => {
|
bus.on('domain/delete-cache', async (domainId: string) => {
|
||||||
|
const ddoc = await DomainModel.get(domainId);
|
||||||
|
if (!ddoc) return;
|
||||||
|
for (const host of ddoc.hosts) {
|
||||||
|
cache.delete(`host::${host}`);
|
||||||
|
}
|
||||||
cache.delete(`id::${domainId}`);
|
cache.delete(`id::${domainId}`);
|
||||||
});
|
});
|
||||||
export default DomainModel;
|
export default DomainModel;
|
||||||
|
|||||||
Reference in new issue
Block a user