Merge pull request #3355 from Ace-Tang/avoid-start-hang

Add timeout in load shim v2
This commit is contained in:
Phil Estes 2019-06-19 11:29:27 +01:00 committed by GitHub
commit 4355a2accc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,8 @@ func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt
events: events,
rtTasks: rt,
}
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
if err := s.Connect(ctx); err != nil {
return nil, err
}