Skip to content

Commit 6cd79d9

Browse files
committed
update cache cleanup script
1 parent a2e091d commit 6cd79d9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/shell/profile-cache-cleaner.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22

33
PROFILE_DIR="/app/.next/server/app/profile"
4-
MAX_DIRS=30000 # change as needed
5-
INTERVAL=600 # 10 minutes
4+
MAX_DIRS=20000 # change as needed
5+
INTERVAL=3600 # 1 hour
66

77
echo "Starting profile cache cleaner. Dir: $PROFILE_DIR, max dirs: $MAX_DIRS, interval: ${INTERVAL}s"
88

@@ -15,11 +15,9 @@ while true; do
1515

1616
if [ "$COUNT" -gt "$MAX_DIRS" ]; then
1717
EXTRA=$((COUNT - MAX_DIRS))
18-
echo "$(date) [profile-cache-cleaner] Need to remove $EXTRA oldest dirs"
1918

2019
ls -dt "$PROFILE_DIR"/*/ 2>/dev/null | tail -n "$EXTRA" | while read DIR; do
2120
if [ -n "$DIR" ]; then
22-
echo " removing $DIR"
2321
rm -rf "$DIR"
2422
fi
2523
done

0 commit comments

Comments
 (0)