-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3679 from KBVE/patch-atomic-preparing-the-docker-…
…image-01-07-2025-1736290584 [CI] Merge patch-atomic-preparing-the-docker-image-01-07-2025-1736290584 into dev
- Loading branch information
Showing
7 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
from fastapi import FastAPI, WebSocket | ||
from pydiscordsh import Routes, CORS | ||
from contextlib import asynccontextmanager | ||
from pydiscordsh import Routes, CORS, TursoDatabase | ||
|
||
import logging | ||
|
||
logger = logging.getLogger("uvicorn") | ||
logger = logging.getLogger("uvicorn") | ||
|
||
app = FastAPI() | ||
routes = Routes(app, templates_dir="templates") | ||
CORS(app) | ||
|
||
routes.get("/", TursoDatabase, "start_client") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .api import Routes, CORS | ||
from .api import Routes, CORS | ||
from .apps import TursoDatabase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .turso import TursoDatabase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import logging | ||
logger = logging.getLogger("uvicorn") | ||
|
||
class TursoDatabase: | ||
async def start_client(self): | ||
return {"status": 200, "message": "Client started successfully."} | ||
|
||
async def stop_client(self): | ||
return {"status": 200, "message": "Client stopped successfully."} | ||
|
||
async def status_client(self): | ||
return {"status": 200, "message": "Client is running."} | ||
|
||
async def close(self): | ||
logger.info("Closing the database connection.") | ||
return {"status": 200, "message": "Database connection closed."} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters