fix(reversi): wait redis operation to improve stability

This commit is contained in:
syuilo 2024-01-24 13:53:55 +09:00
parent 908e0f3b8b
commit a97d4fa4ef

View File

@ -128,7 +128,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
const redisPipeline = this.redisClient.pipeline(); const redisPipeline = this.redisClient.pipeline();
redisPipeline.zadd(`reversi:matchSpecific:${targetUser.id}`, Date.now(), me.id); redisPipeline.zadd(`reversi:matchSpecific:${targetUser.id}`, Date.now(), me.id);
redisPipeline.expire(`reversi:matchSpecific:${targetUser.id}`, 120, 'NX'); redisPipeline.expire(`reversi:matchSpecific:${targetUser.id}`, 120, 'NX');
redisPipeline.exec(); await redisPipeline.exec();
this.globalEventService.publishReversiStream(targetUser.id, 'invited', { this.globalEventService.publishReversiStream(targetUser.id, 'invited', {
user: await this.userEntityService.pack(me, targetUser), user: await this.userEntityService.pack(me, targetUser),