mirror of
https://github.com/vcscsvcscs/GenerationsHeritage.git
synced 2025-08-12 22:09:07 +02:00
add close session func
This commit is contained in:
14
apps/db-adapter/internal/api/closeSession.go
Normal file
14
apps/db-adapter/internal/api/closeSession.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/neo4j/neo4j-go-driver/v5/neo4j"
|
||||
)
|
||||
|
||||
func closeSession(ctx context.Context, session neo4j.SessionWithContext, timeOut time.Duration) {
|
||||
sctx, cancel := context.WithTimeout(ctx, timeOut)
|
||||
session.Close(sctx)
|
||||
cancel()
|
||||
}
|
Reference in New Issue
Block a user