Open Like6po opened 3 months ago
Hello @Like6po , Sorry for not paying attention for a long time.
So yes I understand the problem: session/connection live in a scope of request only.
Yes it's a bug and you detect it right, I thought about this ugly 'create_task' stuff. I'll fix it , thanks for reporting
i got error from this discussion https://github.com/sqlalchemy/sqlalchemy/discussions/9312, when i try use early cache. sqlalchemy.exc.IllegalStateChangeError: Method 'close()' can't be called here; method '_connection_for_bind()' is already in progress and this would cause an unexpected state change to <SessionTransactionState.CLOSED: 5>
what i do:
I took chunks of code from my application to show how roughly the problem can be reproduced, but it's still not working code that can be run. but I think the essence of the problem is clear
I think reason for it bug is /cashews/decorators/cache/early.py line 99
now i will be use just cache, but early looks like good, i want to use this, but its not working for my case :c