perf(api): cache channel and guild reads for the request (#2220)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-31 00:22:52 +02:00
1 parent ab08ed0d7c
commit c4b1471923
11 files changed
+226 -26

No files matched your search

@@ -3,6 +3,7 @@
import type {AttachmentID, ChannelID, EmojiID, GuildID, MessageID, UserID} from '../BrandedTypes';
import type {ChannelRow} from '../database/types/ChannelTypes';
import type {MessageRow} from '../database/types/MessageTypes';
import type {RequestCache} from '../middleware/RequestCacheMiddleware';
import type {Channel} from '../models/Channel';
import type {Message} from '../models/Message';
import type {MessageReaction} from '../models/MessageReaction';
@@ -12,9 +13,9 @@ import {ChannelRepository as NewChannelRepository} from './repositories/ChannelR
export class ChannelRepository extends IChannelRepository {
private repository: NewChannelRepository;
constructor() {
constructor(requestCache?: RequestCache) {
super();
this.repository = new NewChannelRepository();
this.repository = new NewChannelRepository(requestCache);
}
get channelData() {