resources: aws: ec2: Fix closed channel handling
If awschan closes, longpollWatch and snsWatch return nil instead of an error. This will prevent the engine from shutting down in case we choose to close the channel early or from other struct methods.
This commit is contained in:
@@ -469,7 +469,7 @@ func (obj *AwsEc2Res) longpollWatch() error {
|
||||
}
|
||||
case msg, ok := <-obj.awsChan:
|
||||
if !ok {
|
||||
return fmt.Errorf("channel closed unexpectedly")
|
||||
return nil
|
||||
}
|
||||
if err := msg.err; err != nil {
|
||||
return err
|
||||
@@ -650,7 +650,7 @@ func (obj *AwsEc2Res) snsWatch() error {
|
||||
}
|
||||
case msg, ok := <-obj.awsChan:
|
||||
if !ok {
|
||||
return *exit
|
||||
return nil
|
||||
}
|
||||
if err := msg.err; err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user