Auto-commit: v2.10 — Fix Huey consumer never starting (loglevel= TypeError)
Root cause: Consumer(huey, workers=1, worker_type='thread', loglevel=20) raised TypeError on every app start because Huey 2.6.0 does not accept a `loglevel` keyword argument. The exception was silently caught and only printed to stdout, so the consumer never ran and all tasks stayed 'queued' forever — causing the 'Preparing environment / Waiting for logs' hang. Fixes: - web/app.py: Remove invalid `loglevel=20` from Consumer(); configure Huey logging via logging.basicConfig(WARNING) instead. Add persistent error logging to data/consumer_error.log for future diagnosis. - core/config.py: Replace emoji print() calls with ASCII-safe equivalents to prevent UnicodeEncodeError on Windows cp1252 terminals at import time. - core/config.py: Update VERSION to 2.9 (was stale at 1.5.0). - ai_blueprint.md: Bump to v2.10, document root cause and fixes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,9 +27,9 @@ ADMIN_USER = get_clean_env("ADMIN_USERNAME")
|
||||
ADMIN_PASSWORD = get_clean_env("ADMIN_PASSWORD")
|
||||
|
||||
if FLASK_SECRET == "dev-secret-key-change-this":
|
||||
print("⚠️ WARNING: Using default FLASK_SECRET_KEY. This is insecure for production.")
|
||||
print("WARNING: Using default FLASK_SECRET_KEY. This is insecure for production.")
|
||||
|
||||
if not API_KEY: raise ValueError("❌ CRITICAL ERROR: GEMINI_API_KEY not found.")
|
||||
if not API_KEY: raise ValueError("CRITICAL ERROR: GEMINI_API_KEY not found in environment or .env file.")
|
||||
|
||||
# --- DATA DIRECTORIES ---
|
||||
DATA_DIR = os.path.join(BASE_DIR, "data")
|
||||
@@ -51,7 +51,7 @@ if GOOGLE_CREDS:
|
||||
if os.path.exists(GOOGLE_CREDS):
|
||||
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = GOOGLE_CREDS
|
||||
else:
|
||||
print(f"⚠️ Warning: GOOGLE_APPLICATION_CREDENTIALS file not found at: {GOOGLE_CREDS}")
|
||||
print(f"Warning: GOOGLE_APPLICATION_CREDENTIALS file not found at: {GOOGLE_CREDS}")
|
||||
|
||||
# --- DEFINITIONS ---
|
||||
LENGTH_DEFINITIONS = {
|
||||
@@ -65,4 +65,4 @@ LENGTH_DEFINITIONS = {
|
||||
}
|
||||
|
||||
# --- SYSTEM ---
|
||||
VERSION = "1.5.0"
|
||||
VERSION = "2.9"
|
||||
|
||||
Reference in New Issue
Block a user