Add device management to user profile and enhance seat hold expiration handling

This commit is contained in:
Stephanos A
2026-06-04 16:38:58 +03:00
parent bc4d6d079b
commit af14535e08
4 changed files with 57 additions and 7 deletions

View File

@@ -485,8 +485,15 @@ export class SeatsService {
async expireHolds() {
const expired = await this.prisma.seatHold.findMany({ where: { expiresAt: { lt: new Date() } } });
for (const hold of expired) {
await this.releaseSeats(hold.seatIds);
await this.prisma.seatHold.delete({ where: { id: hold.id } });
await this.releaseSeats(hold.seatIds);
try {
await this.prisma.seatHold.delete({ where: { id: hold.id } });
} catch (err) {
// Ignore if already deleted (e.g., by another process)
if (err instanceof Error && !err.message.includes('P2025')) {
throw err;
}
}
}
}
}