Skip to content

Commit

Permalink
fix: πŸ› recreate gRPC stream when it already exists
Browse files Browse the repository at this point in the history
  I think it's better to warn and recreate stream since the upper level
bot does not have direct access to these private method to handle it
properly.

βœ… Closes: #172
  • Loading branch information
hcfw007 committed Oct 25, 2021
1 parent e0118c2 commit 9f0d201
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/puppet-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ export class PuppetService extends Puppet {
log.verbose('PuppetService', 'startGrpcStream()')

if (this.eventStream) {
throw new Error('event stream exists')
this.stopGrpcStream()
log.warn('PuppetService', 'startGrpcStream() grpc stream is already started, will terminate and start new stream')
// throw new Error('event stream exists')
}

let retry = MAX_GRPC_CONNECTION_RETRIES
Expand Down

0 comments on commit 9f0d201

Please sign in to comment.