You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use built-in authentication and create a connection for each user. After the request is done, I close the connection.
Issue that when I close connection it takes ~5s, so I forced to skip Promise from the close function. In case if I don't close the connection, every request will create a new connection and they will spawn memory leaks.
Test:
const connectionIsOpen = provider.status === 0
if (connectionIsOpen) {
console.time('close')
await provider.close() // takes ~5s on await
console.timeEnd('close')
}
Output:
close: 4.993s
Is this desirable behavior?
Steps to reproduce
You can use simple code:
const db = new Surreal("http://localhost:8000");
await db.query(`
SELECT ->fights.out.hero_link as out FROM hero:mr_andersen FETCH out;
`)
console.time('close')
await db.close()
console.timeEnd('close')
Interestingly enough, this differs per runtime. It's fast on Deno but slower on node and bun is another story. Haven't properly looked into it just yet but I've seen similar cases online
Describe the bug
I use built-in authentication and create a connection for each user. After the request is done, I close the connection.
Issue that when I close connection it takes ~5s, so I forced to skip
Promise
from the close function. In case if I don't close the connection, every request will create a new connection and they will spawn memory leaks.Test:
Output:
Is this desirable behavior?
Steps to reproduce
You can use simple code:
Expected behaviour
Can it be as fast as an open connection?
SurrealDB version
1.0.0-beta.9+20230402.5eafebd for linux on x86_64
Contact Details
khoteiv.dev@gmail.com
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: