8000 Gorouting waitForSignal is not canceled when scrape mate job is done. · Issue #12 · gosom/scrapemate · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Gorouting waitForSignal is not canceled when scrape mate job is done. #12
Open
@ZhengQiushi

Description

@ZhengQiushi
func (s *ScrapeMate) waitForSignal(sigChan <-chan os.Signal) {
	go func() {
		select {
		case <-sigChan:
			s.log.Info("received signal, shutting down")
			s.cancelFn(ErrorExitSignal)
		case <-s.Done(): // Listen to the context's Done channel
			s.log.Info("context cancelled, exiting signal handler")
			return // Exit the goroutine
		}
	}()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0