Skip to content

[$50 BOUNTY] [Go] Make analytics collector Start idempotent - #138

Closed
Saiaaax wants to merge 1 commit into
jaxassistant55:mainfrom
Saiaaax:bounty9-v2
Closed

[$50 BOUNTY] [Go] Make analytics collector Start idempotent#138
Saiaaax wants to merge 1 commit into
jaxassistant55:mainfrom
Saiaaax:bounty9-v2

Conversation

@Saiaaax

@Saiaaax Saiaaax commented Jun 25, 2026

Copy link
Copy Markdown

Summary

Makes Collector.Start() idempotent so repeated calls do not create duplicate background workers.

Closes #9

Changes

  • Added started atomic.Bool field to Collector struct
  • Start(ctx) now returns error: nil on first call, ErrAlreadyStarted on repeat
  • Added IsStarted() method to report flush loop state
  • Reset started flag on Stop() and context cancellation
  • 7 unit tests covering all acceptance criteria
  • Updated docs/OPERATIONS.md

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR
  • Documentation has been updated
  • Changes are scoped to the PR purpose

Payout address: 0x5253757322092903C2F0a8EfEed592344216CC7E

- Add started atomic.Bool field to Collector struct
- Start() now returns error: nil on first call, ErrAlreadyStarted on repeat
- Add IsStarted() method to report flush loop state
- Reset started flag on Stop() and context cancellation
- Add 7 unit tests covering single start, repeated start,
  stop-after-repeated-start, start-after-stop, context cancel,
  concurrent start, IsStarted before Start

Closes #9
@Saiaaax

Saiaaax commented Jun 25, 2026

Copy link
Copy Markdown
Author

Superseded by #142 (rebased on latest main to resolve merge conflicts)

@Saiaaax Saiaaax closed this Jun 25, 2026
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.

[$50 BOUNTY] [Go] Make analytics collector Start idempotent

1 participant