GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix][fn]Reset idle timer correctly (#20450) · apache/pulsar@c776e89

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • pulsar-function-go/pf
    • instance.go
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎pulsar-function-go/pf/instance.go‎

Copy file name to clipboardExpand all lines: pulsar-function-go/pf/instance.go
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ func (gi *goInstance) startFunction(function function) error {
149149
defer metricsServicer.close()
150150
CLOSE:
151151
for {
152-
idleTimer.Reset(idleDuration)
153152
select {
154153
case cm := <-channel:
155154
msgInput := cm.Message
@@ -181,6 +180,11 @@ CLOSE:
181180
close(channel)
182181
break CLOSE
183182
}
183+
// reset the idle timer and drain if appropriate before the next loop
184+
if !idleTimer.Stop() {
185+
<-idleTimer.C
186+
}
187+
idleTimer.Reset(idleDuration)
184188
}
185189

186190
gi.closeLogTopic()

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.