hopefully fix workers not kloading the key
This commit is contained in:
1 parent
199995b947
commit
90aca6cca4
2 files changed
+11
-17
No files matched your search
+2
-15
@@ -54,26 +54,13 @@ def on_starting(server):
|
||||
"""Called just before the master process is initialized."""
|
||||
print("Studspider WEB starting...")
|
||||
|
||||
# Load .env file before workers start
|
||||
import dotenv
|
||||
# Verify .env file exists (workers will load it via get_sq_env.py)
|
||||
from pathlib import Path
|
||||
|
||||
env_path = Path(__file__).parent.parent / ".env"
|
||||
print(f"[@DEBUG] Looking for .env at: {env_path.absolute()}")
|
||||
if env_path.exists():
|
||||
dotenv.load_dotenv(env_path)
|
||||
print(f"✓ Loaded environment from {env_path}")
|
||||
|
||||
# Verify key was loaded
|
||||
import os
|
||||
|
||||
key = os.getenv("PROD_SQUARE_WEBHOOK_SIGNATURE_KEY") or os.getenv(
|
||||
"SANDBOX_SQUARE_WEBHOOK_SIGNATURE_KEY"
|
||||
)
|
||||
if key:
|
||||
print(f"✓ SQUARE_WEBHOOK_SIGNATURE_KEY loaded: {key[:10]}...")
|
||||
else:
|
||||
print(f"⚠ SQUARE_WEBHOOK_SIGNATURE_KEY not found in .env")
|
||||
print(f"✓ .env file found (workers will load via get_sq_env.py)")
|
||||
else:
|
||||
print(f"⚠ No .env file found at {env_path.absolute()}")
|
||||
|
||||
|
||||
Reference in new issue
Block a user