Skip to content

Commit e5bd2b3

Browse files
committed
Proper placement of Transaction span.end()
1 parent 5fcc494 commit e5bd2b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/database.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,6 @@ class Database extends common.GrpcServiceObject {
874874
return;
875875
}
876876
span.addEvent('Using Session', {'session.id': session?.id});
877-
span.end();
878877
callback!(null, transaction, resp!);
879878
});
880879
});
@@ -2214,10 +2213,11 @@ class Database extends common.GrpcServiceObject {
22142213
'session.id': session?.id,
22152214
});
22162215
setSpanError(span, err);
2216+
span.end();
22172217
} else {
22182218
setSpanError(span, err);
2219+
span.end();
22192220
}
2220-
span.end();
22212221
cb!(err as grpc.ServiceError | null, transaction);
22222222
});
22232223
});

0 commit comments

Comments
 (0)