fix mute cache expiration

This commit is contained in:
Hazelnoot 2025-11-12 17:20:22 -05:00
parent 8f033d9b89
commit 5ee1621845

View file

@ -261,7 +261,7 @@ export class CacheService implements OnApplicationShutdown {
});
this.userMutingsCache = this.cacheManagementService.createQuantumKVCache<Set<string>>('userMutings', {
lifetime: 1000 * 60 * 30, // 3m (workaround for mute expiration)
lifetime: 1000 * 60 * 3, // 3m (workaround for mute expiration)
fetcher: async muterId => {
const mutings = await this.mutingsRepository.find({ where: { muterId: muterId }, select: ['muteeId'] });
return new Set(mutings.map(muting => muting.muteeId));
@ -283,7 +283,7 @@ export class CacheService implements OnApplicationShutdown {
});
this.userMutedCache = this.cacheManagementService.createQuantumKVCache<Set<string>>('userMuted', {
lifetime: 1000 * 60 * 30, // 3m (workaround for mute expiration)
lifetime: 1000 * 60 * 3, // 3m (workaround for mute expiration)
fetcher: async muteeId => {
const mutings = await this.mutingsRepository.find({ where: { muteeId }, select: ['muterId'] });
return new Set(mutings.map(muting => muting.muterId));