-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove tegola process when there are more than x number
- Loading branch information
Rub21
committed
Aug 17, 2023
1 parent
0c879ce
commit d71be2c
Showing
3 changed files
with
18 additions
and
2 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
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,15 @@ | ||
#!/bin/bash | ||
set -e | ||
if [[ -n "${CLEAN_CACHE_MANUALLY}" && "${CLEAN_CACHE_MANUALLY}" == "true" && "${TILER_CACHE_TYPE}" && "${TILER_CACHE_TYPE}" == "s3" ]]; then | ||
while true; do | ||
NUM_PS_TEGOLA=$(ps | grep ${CACHE_PROCESS_NAME} | grep -v grep | wc -l) | ||
if [[ $NUM_PS_TEGOLA -gt $MAX_PS_TEGOLA ]]; then | ||
aws s3 rm s3://${TILER_CACHE_BUCKET}/mnt/data/osm/ --recursive | ||
echo "${CACHE_PROCESS_NAME} processes" | ||
ps aux | grep ${CACHE_PROCESS_NAME} | grep -v grep | ||
# After clearing the S3 cache, terminate all 'tegola' processes. | ||
killall ${CACHE_PROCESS_NAME} | ||
fi | ||
sleep 600 | ||
done | ||
fi |