Skip to content

Refactor database interactions to use AsyncSession and switch to async cache - #16

Merged
wilsonccccc merged 3 commits into
TensorBlock:mainfrom
lingtonglu:async_db
Jul 20, 2025
Merged

Refactor database interactions to use AsyncSession and switch to async cache#16
wilsonccccc merged 3 commits into
TensorBlock:mainfrom
lingtonglu:async_db

Conversation

@lingtonglu

Copy link
Copy Markdown
Contributor

No description provided.

@lingtonglu
lingtonglu requested a review from wilsonccccc July 18, 2025 05:06
Comment thread app/api/dependencies.py
Comment thread app/api/routes/provider_keys.py Outdated
Comment thread app/api/routes/users.py
Comment thread app/api/routes/users.py
Comment thread app/core/database.py Outdated
Comment thread app/core/cache.py
@lingtonglu
lingtonglu requested a review from wilsonccccc July 19, 2025 08:06
Comment thread app/api/routes/provider_keys.py
Comment thread app/api/schemas/provider_key.py
input_tokens=input_tokens,
output_tokens=output_tokens,
)
finally:

@wilsonccccc wilsonccccc Jul 19, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we need finally?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I missed that. Let me create a asynccontextmanager function to handle the close. And we could reuse it.

@wilsonccccc

Copy link
Copy Markdown
Contributor

Overall LGTM, once check the last few comments, I think it is good to go

Comment thread app/api/dependencies.py
@lingtonglu
lingtonglu requested a review from wilsonccccc July 20, 2025 05:13
@wilsonccccc
wilsonccccc merged commit 13920d4 into TensorBlock:main Jul 20, 2025
3 checks passed
@lingtonglu
lingtonglu deleted the async_db branch July 29, 2025 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants