Spaces:
Sleeping
Sleeping
fix typo
Browse files- src/app/app.py +5 -4
src/app/app.py
CHANGED
|
@@ -17,11 +17,12 @@ DATABASE_URL = os.getenv("DATABASE_URL")
|
|
| 17 |
if DATABASE_URL and DATABASE_URL.startswith("postgres://"):
|
| 18 |
DATABASE_URL = DATABASE_URL.replace("postgres://", "postgresql+asyncpg://", 1)
|
| 19 |
|
| 20 |
-
if DATABASE_URL:
|
| 21 |
-
|
| 22 |
else:
|
| 23 |
-
|
| 24 |
-
|
|
|
|
| 25 |
@asynccontextmanager
|
| 26 |
async def lifespan(app: FastAPI):
|
| 27 |
print("Starting up...")
|
|
|
|
| 17 |
if DATABASE_URL and DATABASE_URL.startswith("postgres://"):
|
| 18 |
DATABASE_URL = DATABASE_URL.replace("postgres://", "postgresql+asyncpg://", 1)
|
| 19 |
|
| 20 |
+
if not DATABASE_URL:
|
| 21 |
+
log.warning("DATABASE_URL not found. Database features will be unavailable.")
|
| 22 |
else:
|
| 23 |
+
if DATABASE_URL.startswith("postgres://"):
|
| 24 |
+
DATABASE_URL = DATABASE_URL.replace("postgres://", "postgresql+asyncpg://", 1)
|
| 25 |
+
|
| 26 |
@asynccontextmanager
|
| 27 |
async def lifespan(app: FastAPI):
|
| 28 |
print("Starting up...")
|