From e8f99e963ba98615d85eb8a717f8fc47cf5c9136 Mon Sep 17 00:00:00 2001 From: Yury Kossakovsky Date: Wed, 6 Aug 2025 19:04:24 -0600 Subject: [PATCH] Reduce Dify initialization wait time from 15 to 10 seconds in start_services.py. Update apply_update.sh to include checks for Dify's Docker Compose file, ensuring it is pulled if available. --- scripts/apply_update.sh | 11 +++++++++-- start_services.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/apply_update.sh b/scripts/apply_update.sh index 29d9aa7..0cfc112 100755 --- a/scripts/apply_update.sh +++ b/scripts/apply_update.sh @@ -48,14 +48,21 @@ log_success "Service selection updated." # Pull latest versions of selected containers based on updated .env log_info "Pulling latest versions of selected containers..." COMPOSE_FILES_FOR_PULL=("-f" "$PROJECT_ROOT/docker-compose.yml") -SUPABASE_DOCKER_DIR="$PROJECT_ROOT/supabase/docker" -SUPABASE_COMPOSE_FILE_PATH="$SUPABASE_DOCKER_DIR/docker-compose.yml" # Check if Supabase directory and its docker-compose.yml exist +SUPABASE_DOCKER_DIR="$PROJECT_ROOT/supabase/docker" +SUPABASE_COMPOSE_FILE_PATH="$SUPABASE_DOCKER_DIR/docker-compose.yml" if [ -d "$SUPABASE_DOCKER_DIR" ] && [ -f "$SUPABASE_COMPOSE_FILE_PATH" ]; then COMPOSE_FILES_FOR_PULL+=("-f" "$SUPABASE_COMPOSE_FILE_PATH") fi +# Check if Dify directory and its docker-compose.yaml exist +DIFY_DOCKER_DIR="$PROJECT_ROOT/dify/docker" +DIFY_COMPOSE_FILE_PATH="$DIFY_DOCKER_DIR/docker-compose.yaml" +if [ -d "$DIFY_DOCKER_DIR" ] && [ -f "$DIFY_COMPOSE_FILE_PATH" ]; then + COMPOSE_FILES_FOR_PULL+=("-f" "$DIFY_COMPOSE_FILE_PATH") +fi + # Use the project name "localai" for consistency. # This command WILL respect COMPOSE_PROFILES from the .env file (updated by the wizard above). $COMPOSE_CMD -p "localai" "${COMPOSE_FILES_FOR_PULL[@]}" pull --ignore-buildable || { diff --git a/start_services.py b/start_services.py index b891a57..d8a802b 100755 --- a/start_services.py +++ b/start_services.py @@ -423,7 +423,7 @@ def main(): start_dify() # Give Dify some time to initialize print("Waiting for Dify to initialize...") - time.sleep(15) + time.sleep(10) # Then start the local AI services start_local_ai()