perf(backend): store notes of an antenna to redis instead of postgresql

Resolve #10169
This commit is contained in:
syuilo 2023-04-03 12:11:16 +09:00
parent c032dd1214
commit b53d6c7f8c
14 changed files with 64 additions and 179 deletions

View file

@ -326,7 +326,11 @@ export class NoteCreateService implements OnApplicationShutdown {
const note = await this.insertNote(user, data, tags, emojis, mentionedUsers);
if (data.channel) {
this.redisClient.xadd(`channelTimeline:${data.channel.id}`, 'MAXLEN', '~', '1000', `${this.idService.parse(note.id).date.getTime()}-*`, 'note', note.id);
this.redisClient.xadd(
`channelTimeline:${data.channel.id}`,
'MAXLEN', '~', '1000',
`${this.idService.parse(note.id).date.getTime()}-*`,
'note', note.id);
}
setImmediate('post created', { signal: this.#shutdownController.signal }).then(