Refactor fleet module and add cleanup script
- Update Celery configuration in celery.py - Modify base settings for improved performance - Enhance task management in fleet tasks.py - Revise fleet views.py for better data handling - Add cleanup_tmp_archives.sh script for temporary file management - Adjust docker-compose.prod.yml for consistency - Optimize fleetDashboardStore.js with reduced code complexity
This commit is contained in:
12
backend/scripts/cleanup_tmp_archives.sh
Normal file
12
backend/scripts/cleanup_tmp_archives.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
TARGET_DIR="${TMP_ARCHIVE_DIR:-/tmp/erp-generated-archives}"
|
||||
RETENTION_DAYS="${TMP_RETENTION_DAYS:-1}"
|
||||
|
||||
if [ ! -d "$TARGET_DIR" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
find "$TARGET_DIR" -type f -name '*.zip' -mtime +"$RETENTION_DAYS" -delete
|
||||
find "$TARGET_DIR" -type d -empty -delete
|
||||
Reference in New Issue
Block a user