Skip to content

Commit

Permalink
singleton pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
norton120 committed Dec 2, 2024
1 parent 62b0147 commit 2b8d2ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions letta/server/rest_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def on_startup():
# Tool.load_default_tools(get_db_session())

generate_openapi_schema(app)
# always migrate now that we have a default in-memory postgres

@app.on_event("shutdown")
def on_shutdown():
Expand Down
4 changes: 2 additions & 2 deletions letta/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def letta_pg_uri(self) -> str:
return f"postgresql+pg8000://{self.pg_user}:{self.pg_password}@{self.pg_host}:{self.pg_port}/{self.pg_db}"
else:
# start the pg binary. This is the default in-memory postgres that replaces SQLite/Chroma
db_uri = self.launch_pg_binary()
return db_uri
self.pg_uri = self.launch_pg_binary()
return self.pg_uri

@property
def letta_pg_uri_no_default(self) -> str:
Expand Down

0 comments on commit 2b8d2ad

Please sign in to comment.