Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple workers to the signal collection #125

Merged
merged 2 commits into from
Jun 1, 2022
Merged

Conversation

calebbrown
Copy link
Contributor

No description provided.

Copy link
Contributor

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

cmd/collect_signals/main.go Outdated Show resolved Hide resolved
}
if err := scanner.Err(); err != nil {
logger.WithFields(log.Fields{
"error": err,
}).Error("Failed while reading input")
os.Exit(2)
}
// Close the repos channel to indicate that there is no more input.
close(repos)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be in a defer instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. It needs to happen before wait() defer would force it to happen afterwards.

At some point I will need to gracefully terminate other workers on a SIGTERM or a dead worker (unrecoverable error), but that will need more improvements.

@calebbrown calebbrown merged commit b84e865 into main Jun 1, 2022
@calebbrown calebbrown deleted the workers branch June 1, 2022 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants