Skip to content

No way to wait for non-blocking logging #4

@deadmoose

Description

@deadmoose

It's (somewhat) not a problem for a long-lived things, but the checked-in example demonstrates it:

  • It logs a message, this fires off a goroutine to post to slack
  • End of main() is reached & the program terminates

The goroutine never gets a chance to do anything, so nothing makes it to slack.

Tossing a time.Sleep() in obviously let me prove the handler does work when given the opportunity to, but I don't have any brilliant suggestions around a more general solution.

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