Skip to content

Commit

Permalink
fix: minor changes and fixes in the api on names
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjibansg committed Oct 16, 2023
1 parent 110a327 commit 32ee764
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
app = FastAPI()

allowed_urls = [
"substrait-fiddle.com",
"substrait-fiddle.com",
"*.substrait-fiddle.com",
"127.0.0.1",
Expand All @@ -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:
Expand Down Expand Up @@ -69,7 +68,7 @@ async def initialize():
)


@app.get("/health/duckcb/")
@app.get("/health/duckdb/")
def check_backend_conn(conn):
check_duckdb_connection(conn)

Expand Down
2 changes: 1 addition & 1 deletion api/backend/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 32ee764

Please sign in to comment.