refactor(session connections): Refactor connection closure

This commit is contained in:
irenarindos committed 2022-03-15 12:11:31 -04:00
1 parent 3482f91a17
commit 32132d6bc1
13 files changed
+560 -152

No files matched your search

@@ -469,12 +469,17 @@ func (ws *workerServiceServer) CloseConnection(ctx context.Context, req *pbs.Clo
ClosedReason: session.ClosedReason(v.GetReason()),
})
}
connRepo, err := ws.connectionRepoFn()
if err != nil {
return nil, status.Errorf(codes.Internal, "error getting connection repo: %v", err)
}
sessRepo, err := ws.sessionRepoFn()
if err != nil {
return nil, status.Errorf(codes.Internal, "error getting session repo: %v", err)
}
closeInfos, err := sessRepo.CloseConnections(ctx, closeWiths)
closeInfos, err := session.CloseConnections(ctx, sessRepo, connRepo, closeWiths)
if err != nil {
return nil, err
}