-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script to execute the main process and some other adapters sequentially
- Loading branch information
Rub21
committed
Aug 24, 2021
1 parent
e22764e
commit 694a641
Showing
3 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# !/usr/bin/env bash | ||
# Script to fetch data adapter by adapter | ||
adapters=adapters.list | ||
for file in ./sources/*.json; do | ||
jq '.[] | select(.active == true ).name' $file | sed -r 's/^"|"$//g' >>$adapters | ||
done | ||
|
||
while read adapter; do | ||
echo "================================> $adapter <================================" | ||
node index.js --source "$adapter" -b | ||
done <$adapters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
# !/usr/bin/env bash | ||
adapters=adapters.list | ||
for file in ./sources/*.json; do | ||
jq '.[] | select(.active == true ).name' $file | sed -r 's/^"|"$//g' >>$adapters | ||
done | ||
# This script intends to run the main fetch data process and other processes sequentially. | ||
# The script also has a timeout to kill the process in case it gets stuck. | ||
echo "Start main fetch process" | ||
timeout 5m npm start | ||
|
||
while read adapter; do | ||
echo "================================> $adapter <================================" | ||
node index.js --source "$adapter" -b | ||
done <$adapters | ||
echo "Start ccmaq - indian adapter" | ||
timeout 20m node index.js --source="caaqm" |