MCPcopy Create free account
hub / github.com/QuantumNous/new-api / waitForTaskPluginProtocolTick

Function waitForTaskPluginProtocolTick

controller/plugin_protocol.go:636–658  ·  view source on GitHub ↗
(
	c *gin.Context,
	observationContext context.Context,
	heartbeatTicker *time.Ticker,
	delay time.Duration,
)

Source from the content-addressed store, hash-verified

634}
635
636func 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
660func waitTaskPluginProtocol(
661 c *gin.Context,

Callers 1

streamTaskPluginProtocolFunction · 0.85

Calls 3

StopMethod · 0.80
DoneMethod · 0.45

Tested by

no test coverage detected