Skip to content

Commit 4a5d6db

Browse files
committed
do not retry operations when client is shutdown
1 parent 66be975 commit 4a5d6db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/invocation/InvocationService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ export class InvocationService {
261261

262262
private notifyError(invocation: Invocation, error: Error): void {
263263
var correlationId = invocation.request.getCorrelationId().toNumber();
264-
if (this.isRetryable(invocation)) {
264+
if (!this.client.getLifecycleService().isRunning()) {
265+
invocation.deferred.reject(new ClientNotActiveError('Client is not active.', error));
266+
} else if (this.isRetryable(invocation)) {
265267
this.logger.debug('InvocationService',
266268
'Retrying(' + invocation.invokeCount + ') on correlation-id=' + correlationId, error);
267269
if (invocation.invokeCount < MAX_FAST_INVOCATION_COUNT) {

0 commit comments

Comments
 (0)