File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -3214,7 +3214,7 @@ class Database extends common.GrpcServiceObject {
32143214 : { } ;
32153215
32163216 startTrace ( 'Database.runTransaction' , this . _traceConfig , span => {
3217- this . pool_ . getSession ( ( err , session ?, transaction ?) => {
3217+ this . pool_ . getSession ( async ( err , session ?, transaction ?) => {
32183218 if ( err ) {
32193219 setSpanError ( span , err ) ;
32203220 }
@@ -3223,7 +3223,7 @@ class Database extends common.GrpcServiceObject {
32233223 span . addEvent ( 'No session available' , {
32243224 'session.id' : session ?. id ,
32253225 } ) ;
3226- this . runTransaction ( options , runFn ! ) ;
3226+ await this . runTransaction ( options , runFn ! ) ;
32273227 span . end ( ) ;
32283228 return ;
32293229 }
@@ -3259,7 +3259,6 @@ class Database extends common.GrpcServiceObject {
32593259 setSpanError ( span , err ! ) ;
32603260 }
32613261 await runFn ! ( err , resp ) ;
3262- span . end ( ) ;
32633262 } ,
32643263 options
32653264 ) ;
Original file line number Diff line number Diff line change @@ -1320,7 +1320,7 @@ export class Snapshot extends EventEmitter {
13201320 this . _update ( response . metadata ! . transaction ) ;
13211321 }
13221322 } )
1323- . on ( 'error' , err => {
1323+ . on ( 'error' , async err => {
13241324 setSpanError ( span , err as Error ) ;
13251325 const isServiceError =
13261326 err && typeof err === 'object' && 'code' in err ;
@@ -1332,7 +1332,7 @@ export class Snapshot extends EventEmitter {
13321332 ( err as grpc . ServiceError ) . code === grpc . status . ABORTED
13331333 )
13341334 ) {
1335- this . begin ( ) ;
1335+ await this . begin ( ) ;
13361336 }
13371337 } )
13381338 . on ( 'end' , err => {
You can’t perform that action at this time.
0 commit comments