A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/cloudflare/gokeyless/commit/92fec075fff1781e99aee80294f4c683539c9b8c below:

Add additional span for wait between write and response. (#280) · cloudflare/gokeyless@92fec07 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+3

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+3

-0

lines changed Original file line number Diff line number Diff line change

@@ -264,13 +264,15 @@ func (c *Conn) DoOperation(ctx context.Context, op protocol.Operation) (*protoco

264 264

if err != nil {

265 265

return nil, fmt.Errorf("could not write to connection: %v", err)

266 266

}

267 +

waitingSpan, ctx := opentracing.StartSpanFromContext(ctx, "Conn.DoOperation.Waiting")

267 268 268 269

// Take into account how long we've already been waiting since the beginning

269 270

// of writing to the connection (which could have taken a while if the

270 271

// connection was backed up).

271 272

left := end.Sub(time.Now())

272 273

select {

273 274

case op := <-response:

275 +

waitingSpan.Finish()

274 276

c.mapMtx.Lock()

275 277

delete(c.listeners, id)

276 278

c.mapMtx.Unlock()

@@ -279,6 +281,7 @@ func (c *Conn) DoOperation(ctx context.Context, op protocol.Operation) (*protoco

279 281

}

280 282

return op, nil

281 283

case <-time.After(left):

284 +

waitingSpan.Finish()

282 285

c.mapMtx.Lock()

283 286

delete(c.listeners, id)

284 287

c.mapMtx.Unlock()

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4