-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UserContext inits evey rest call #149
Comments
Yeah, I think global variables are still needed for extend. Now extend is limited to accepting no externel arguments. I think it can probably be changed into accepting a pointer from users. |
Yes, for me it looks like a pretty critical problem, it turns out state can only be stored in databases. |
Oh, and ofc, creating new Database connection for each call is the biggest problem here. I will try use session, but I think context is more suitable place |
@gavr123456789 I am slightly confused, isn't the extend proc being called once per request exactly what is desired? Is that not how it's supposed to be done? I'm pretty sure I'm having a lot of misunderstandings here, I'm just not spotting where they are. |
I added echo to the extend method, and noticed that it fires every time. This means that a new connection to mongo is opened every time. Also because of this, I can't mutate the data inside the UserContext to implement an InMemory session that uses TableRef instead of mongo.
Here my test project https://github.com/gavr123456789/full-stack-try/blob/main/backend/Nim/app.nim#L10
I think it can be related to #137
The text was updated successfully, but these errors were encountered: