Skip to content

Commit

Permalink
fix(core): Fix worker becoming unresponsive after errors
Browse files Browse the repository at this point in the history
Fixes #250
  • Loading branch information
michaelbromley committed Jan 24, 2020
1 parent 465f81e commit 0f905b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/worker/worker.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Inject, Injectable, OnModuleDestroy } from '@nestjs/common';
import { ClientProxy } from '@nestjs/microservices';
import { BehaviorSubject, Observable } from 'rxjs';
import { filter, mergeMap, take, tap } from 'rxjs/operators';
import { filter, finalize, mergeMap, take } from 'rxjs/operators';

import { VENDURE_WORKER_CLIENT } from './constants';
import { WorkerMessage } from './types';
Expand Down Expand Up @@ -36,7 +36,7 @@ export class WorkerService implements OnModuleDestroy {
return this.client
.send<R, T>((message.constructor as typeof WorkerMessage).pattern, message.data)
.pipe(
tap(() => {
finalize(() => {
this.initialConnection.next(true);
this.pendingConnection = false;
}),
Expand Down

0 comments on commit 0f905b0

Please sign in to comment.