Skip to content

Commit

Permalink
Increase chance of purging old CAR cache to 50%
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Rodriguez Baquero committed Jul 17, 2023
1 parent a7671e3 commit 528b082
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions container/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ echo "$(date -u) [container] Disk: $(df -h /usr/src/app/shared | awk '(NR>1)')"
mkdir -p /usr/src/app/shared/ssl
mkdir -p /usr/src/app/shared/nginx_log

# Clean up old cached CAR files with 10% chance and if not already cleaned up
if [ "$RANDOM" -lt 6554 ] && [ ! -f "/usr/src/app/shared/cleaned_cache" ]; then
# Clean up old cached CAR files with 50% chance and if not already cleaned up
if [ "$RANDOM" -lt 16384 ] && [ ! -f "/usr/src/app/shared/cleaned_cache" ]; then
echo "$(date -u) [container] Cleaning up old cached CAR files"
grep -rl '/usr/src/app/shared/nginx_cache' -e 'carentity' -e 'carall' | xargs rm -f
touch /usr/src/app/shared/cleaned_cache
Expand Down

0 comments on commit 528b082

Please sign in to comment.