Skip to content

Commit 5bcf0b6

Browse files
Adding filters for key-phrases and dominant-language
Adding filters for key-phrases and dominant-language
1 parent 23ee222 commit 5bcf0b6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

resources/comprehend_dominant_language_detection_job.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ func ListComprehendDominantLanguageDetectionJobs(sess *session.Session) ([]Resou
2222
return nil, err
2323
}
2424
for _, dominantLanguageDetectionJob := range resp.DominantLanguageDetectionJobPropertiesList {
25+
switch *dominantLanguageDetectionJob.JobStatus {
26+
case "STOPPED", "FAILED", "COMPLETED":
27+
// if the job has already been stopped, failed, or completed; do not try to stop it again
28+
continue
29+
}
2530
resources = append(resources, &ComprehendDominantLanguageDetectionJob{
2631
svc: svc,
2732
dominantLanguageDetectionJob: dominantLanguageDetectionJob,

resources/comprehend_key_phrases_detection_job.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ func ListComprehendKeyPhrasesDetectionJobs(sess *session.Session) ([]Resource, e
2222
return nil, err
2323
}
2424
for _, keyPhrasesDetectionJob := range resp.KeyPhrasesDetectionJobPropertiesList {
25+
switch *keyPhrasesDetectionJob.JobStatus {
26+
case "STOPPED", "FAILED", "COMPLETED":
27+
// if the job has already been stopped, failed, or completed; do not try to stop it again
28+
continue
29+
}
2530
resources = append(resources, &ComprehendKeyPhrasesDetectionJob{
2631
svc: svc,
2732
keyPhrasesDetectionJob: keyPhrasesDetectionJob,

0 commit comments

Comments
 (0)