lab3: итог
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user