( c *gin.Context, observationContext context.Context, heartbeatTicker *time.Ticker, delay time.Duration, )
| 634 | } |
| 635 | |
| 636 | func waitForTaskPluginProtocolTick( |
| 637 | c *gin.Context, |
| 638 | observationContext context.Context, |
| 639 | heartbeatTicker *time.Ticker, |
| 640 | delay time.Duration, |
| 641 | ) bool { |
| 642 | tickTimer := time.NewTimer(delay) |
| 643 | defer tickTimer.Stop() |
| 644 | for { |
| 645 | select { |
| 646 | case <-c.Request.Context().Done(): |
| 647 | return false |
| 648 | case <-observationContext.Done(): |
| 649 | return false |
| 650 | case <-heartbeatTicker.C: |
| 651 | if err := writeTaskPluginProtocolHeartbeat(c); err != nil { |
| 652 | return false |
| 653 | } |
| 654 | case <-tickTimer.C: |
| 655 | return true |
| 656 | } |
| 657 | } |
| 658 | } |
| 659 | |
| 660 | func waitTaskPluginProtocol( |
| 661 | c *gin.Context, |
no test coverage detected