File tree Expand file tree Collapse file tree 1 file changed +23
-11
lines changed
Expand file tree Collapse file tree 1 file changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -18,19 +18,31 @@ updateAll() {
1818
1919 for dir in ../* ; do
2020 if [[ -d " $dir " ]]; then
21-
22- set +e
23- (update " ${dir# ../ } " " $wiremock_cloud_url " " $wiremock_cloud_username " " $wiremock_cloud_api_token " )
24- local result=$?
25- set -e
26-
27- if [[ result -eq 0 ]]; then
28- echo " Imported $dir "
29- else
30- >&2 echo " Failed to import $dir "
21+ (updateAsync) &
22+ if [[ $( jobs -r -p | wc -l) -ge 10 ]]; then
23+ # now there are $N jobs already running, so wait here for any job
24+ # to be finished so there is a place to start next one.
25+ wait -n
3126 fi
3227 fi
3328 done
29+
30+ wait
31+
32+ echo " All imported"
33+ }
34+
35+ updateAsync () {
36+ set +e
37+ (update " ${dir# ../ } " " $wiremock_cloud_url " " $wiremock_cloud_username " " $wiremock_cloud_api_token " )
38+ local result=$?
39+ set -e
40+
41+ if [[ result -eq 0 ]]; then
42+ echo " Imported $dir "
43+ else
44+ >&2 echo " Failed to import $dir "
45+ fi
3446}
3547
3648update () {
@@ -89,4 +101,4 @@ curl_auth() {
89101 " $@ "
90102}
91103
92- update " $@ "
104+ updateAll " $@ "
You can’t perform that action at this time.
0 commit comments