Skip to content

Commit 23ee222

Browse files
Updating detection filters.
Adding `Completed` to the job status types that are ignored upon cleanup.
1 parent 150eb13 commit 23ee222

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

resources/comprehend_entities_detection_job.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ func ListComprehendEntitiesDetectionJobs(sess *session.Session) ([]Resource, err
2222
return nil, err
2323
}
2424
for _, entitiesDetectionJob := range resp.EntitiesDetectionJobPropertiesList {
25-
if *entitiesDetectionJob.JobStatus == "STOPPED" ||
26-
*entitiesDetectionJob.JobStatus == "FAILED" {
27-
// if the job has already been stopped, do not try to delete it again
25+
switch *entitiesDetectionJob.JobStatus {
26+
case "STOPPED", "FAILED", "COMPLETED":
27+
// if the job has already been stopped, failed, or completed; do not try to stop it again
2828
continue
2929
}
3030
resources = append(resources, &ComprehendEntitiesDetectionJob{

resources/comprehend_sentiment_detection_job.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ func ListComprehendSentimentDetectionJobs(sess *session.Session) ([]Resource, er
2222
return nil, err
2323
}
2424
for _, sentimentDetectionJob := range resp.SentimentDetectionJobPropertiesList {
25-
if *sentimentDetectionJob.JobStatus == "STOPPED" ||
26-
*sentimentDetectionJob.JobStatus == "FAILED" {
27-
// if the job has already been stopped, do not try to delete it again
25+
switch *sentimentDetectionJob.JobStatus {
26+
case "STOPPED", "FAILED", "COMPLETED":
27+
// if the job has already been stopped, failed, or completed; do not try to stop it again
2828
continue
2929
}
3030
resources = append(resources, &ComprehendSentimentDetectionJob{

0 commit comments

Comments
 (0)