Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented Oct 7, 2025

Add distinct payer report generation periods to configure self at 6h and others at 12h and update workers to use these durations

This change introduces separate configuration for payer report generation periods for self and others and updates the worker pipeline to consume these values. It adds two time.Duration fields to config.PayerReportOptions, threads them through server initialization, validates them in the worker config builder, and updates the generator worker to apply the correct interval based on report origin.

  • Update configuration to add GenerateReportSelfPeriod (default 6h) and GenerateReportOthersPeriod (default 12h) in options.go
  • Modify workers.GeneratorWorker to hold generateSelfPeriod and generateOthersPeriod and select between them in workers.GeneratorWorker.isOlderThanReportInterval in generator.go
  • Extend workers.WorkerConfigBuilder with WithGenerationSelfPeriod and WithGenerationOthersPeriod, validate periods > 0 in Build, and pass them in RunWorkers in runner.go
  • Wire new options through server construction in server.go
  • Adjust tests to use the new constructor signature and set short periods in test options in integration_test.go and server.go

📍Where to Start

Start with the worker configuration flow in workers.RunWorkers and workers.WorkerConfigBuilder.Build to see how periods are validated and injected, then review workers.GeneratorWorker.isOlderThanReportInterval for the selection logic in runner.go and generator.go.


Macroscope summarized 96ae951.

@mkysel mkysel requested a review from a team as a code owner October 7, 2025 19:58
@mkysel mkysel force-pushed the mkysel/submitter-locks branch from 63baf29 to c47c7ee Compare October 8, 2025 14:19
@mkysel mkysel requested a review from neekolas October 8, 2025 14:28
@mkysel mkysel force-pushed the mkysel/do-not-report-others-as-frequently branch from 8649e5a to a603f92 Compare October 8, 2025 14:29
@mkysel mkysel changed the base branch from mkysel/submitter-locks to main October 8, 2025 14:29
@mkysel mkysel force-pushed the mkysel/do-not-report-others-as-frequently branch from a603f92 to 96ae951 Compare October 8, 2025 14:45
@mkysel mkysel merged commit 4fdc07f into main Oct 8, 2025
11 of 12 checks passed
@mkysel mkysel deleted the mkysel/do-not-report-others-as-frequently branch October 8, 2025 20:18
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.

3 participants