Open jregistr opened 6 months ago
Anyways, I've switched to sharing the DB and then getting a new connection in the handler and I no longer get the issue.
Hi thanks for letting me know! I can't reproduce it though, how exactly did you get the error? I tried starting the app, opening a page which contains a database call, waiting 10 minutes and then refreshing the page.
Interesting. I'll try it again. Perhaps there's something else in my environment. I'll submit a branch with example.
Hi. I found this repo searching for example using turso and axum. I've done some testing and found that using a Connection that is shared as State results in errors after a some successful requests if there's a pause.
Here's what I tested.
main.rs
file with user route
Worth noting Turso has an example over here: https://docs.turso.tech/sdk/rust/guides/axum They construct both the DB and the connection in the handler.