From 32ee76436336dc83da27c5ca226699244e9c1171 Mon Sep 17 00:00:00 2001 From: Sanjiban Sengupta Date: Tue, 17 Oct 2023 05:26:57 +0530 Subject: [PATCH] fix: minor changes and fixes in the api on names --- api/app.py | 5 ++--- api/backend/duckdb.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/api/app.py b/api/app.py index 6cc8a63d..e94d74fd 100644 --- a/api/app.py +++ b/api/app.py @@ -19,7 +19,6 @@ app = FastAPI() allowed_urls = [ - "substrait-fiddle.com", "substrait-fiddle.com", "*.substrait-fiddle.com", "127.0.0.1", @@ -31,7 +30,7 @@ async def get_duck_conn(): - conn = app.state.duck_pool.initialize() + conn = app.state.duck_pool.get_connection() try: yield conn finally: @@ -69,7 +68,7 @@ async def initialize(): ) -@app.get("/health/duckcb/") +@app.get("/health/duckdb/") def check_backend_conn(conn): check_duckdb_connection(conn) diff --git a/api/backend/duckdb.py b/api/backend/duckdb.py index 6d6065dd..66ff7c97 100644 --- a/api/backend/duckdb.py +++ b/api/backend/duckdb.py @@ -41,7 +41,7 @@ def check_pool(self): conn.load_extension("substrait") self.conn_pool.append(conn) - def initialize(self): + def get_connection(self): self.check_pool() con = self.conn_pool.pop(0) return con