lab3: итог

This commit is contained in:
2026-10-16 16:18:15 +03:00
parent 6cced49486
commit e42f02c016
141 changed files with 3180 additions and 4753 deletions
+7 -6
View File
@@ -95,21 +95,22 @@ export class MessagesService {
'Idempotency key could not be claimed',
);
}
if (stored.request_fingerprint !== fingerprint) {
this.metrics.increment('idempotency.conflict');
throw new ConflictException(
'Idempotency key reused with a different body',
);
}
if (stored.expired) {
this.metrics.increment('idempotency.released');
await this.idempotency.forget(
currentUser.id,
path,
rawKey,
ttl,
);
continue;
}
if (stored.request_fingerprint !== fingerprint) {
this.metrics.increment('idempotency.conflict');
throw new ConflictException(
'Idempotency key reused with a different body',
);
}
if (!stored.is_member) throw new NotFoundException();
this.metrics.increment('idempotency.replay');
return stored.response_body;