This commit is contained in:
@@ -3,6 +3,10 @@
|
|||||||
# ParentZone Downloaders Daily Scheduler
|
# ParentZone Downloaders Daily Scheduler
|
||||||
# This script runs both the config downloader and snapshot downloader
|
# This script runs both the config downloader and snapshot downloader
|
||||||
|
|
||||||
|
# Set environment variables (cron doesn't inherit Docker ENV vars)
|
||||||
|
export PYTHONPATH=/app
|
||||||
|
export PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
LOG_DIR="/app/data/logs"
|
LOG_DIR="/app/data/logs"
|
||||||
LOG_FILE="$LOG_DIR/scheduler_$(date +%Y%m%d).log"
|
LOG_FILE="$LOG_DIR/scheduler_$(date +%Y%m%d).log"
|
||||||
SNAPSHOT_CONFIG_FILE="/app/config/snapshot_config.json"
|
SNAPSHOT_CONFIG_FILE="/app/config/snapshot_config.json"
|
||||||
@@ -51,6 +55,9 @@ run_with_logging() {
|
|||||||
# Main execution
|
# Main execution
|
||||||
log_message "=== ParentZone Downloaders Daily Run Started ==="
|
log_message "=== ParentZone Downloaders Daily Run Started ==="
|
||||||
|
|
||||||
|
# Change to app directory first
|
||||||
|
cd /app
|
||||||
|
|
||||||
# Debug: Log environment information
|
# Debug: Log environment information
|
||||||
log_message "=== DEBUG: Environment Information ==="
|
log_message "=== DEBUG: Environment Information ==="
|
||||||
log_message "PATH: $PATH"
|
log_message "PATH: $PATH"
|
||||||
@@ -59,6 +66,7 @@ log_message "PWD: $(pwd)"
|
|||||||
log_message "USER: $(whoami)"
|
log_message "USER: $(whoami)"
|
||||||
log_message "which python3: $(which python3 2>&1 || echo 'NOT FOUND')"
|
log_message "which python3: $(which python3 2>&1 || echo 'NOT FOUND')"
|
||||||
log_message "python3 --version: $(python3 --version 2>&1 || echo 'FAILED')"
|
log_message "python3 --version: $(python3 --version 2>&1 || echo 'FAILED')"
|
||||||
|
log_message "ls -la src/: $(ls -la src/ 2>&1 | head -5)"
|
||||||
log_message "=== END DEBUG ==="
|
log_message "=== END DEBUG ==="
|
||||||
|
|
||||||
# Check if config files exist
|
# Check if config files exist
|
||||||
@@ -74,8 +82,6 @@ else
|
|||||||
SKIP_ASSET_DOWNLOADER=false
|
SKIP_ASSET_DOWNLOADER=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /app
|
|
||||||
|
|
||||||
# Run config-based asset downloader
|
# Run config-based asset downloader
|
||||||
if [ "$SKIP_ASSET_DOWNLOADER" = false ]; then
|
if [ "$SKIP_ASSET_DOWNLOADER" = false ]; then
|
||||||
run_with_logging "python3 src/config_downloader.py --config $ASSET_CONFIG_FILE" "Config Asset Downloader"
|
run_with_logging "python3 src/config_downloader.py --config $ASSET_CONFIG_FILE" "Config Asset Downloader"
|
||||||
|
|||||||
Reference in New Issue
Block a user