File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,17 @@ INIT_FILE="$WORKDIR/init_done"
1919
2020mkdir -p " $CACHE_DIR " " $DIFF_DIR " " $IMPOSM3_EXPIRE_DIR "
2121
22+ # Archive old imposm log before clearing, so we can debug what caused the restart
23+ IMPOSM_LOG_DIR=" $WORKDIR /imposm_logs"
24+ mkdir -p " $IMPOSM_LOG_DIR "
25+ if [ -s /tmp/imposm.log ]; then
26+ cp /tmp/imposm.log " $IMPOSM_LOG_DIR /imposm_$( date +%Y%m%d_%H%M%S) .log"
27+ # Keep only the last 20 log files to avoid filling the volume
28+ ls -t " $IMPOSM_LOG_DIR " /imposm_* .log 2> /dev/null | tail -n +21 | xargs rm -f 2> /dev/null
29+ fi
30+ # Clear log to prevent liveness probe from detecting stale errors on restart
31+ > /tmp/imposm.log
32+
2233# Tracking file for uploaded files
2334TRACKING_FILE=" $WORKDIR /uploaded_files.log"
2435[ -f " $TRACKING_FILE " ] || touch " $TRACKING_FILE "
You can’t perform that action at this time.
0 commit comments