fix: remove WithSchedulerInterval and use hardcoded 24h interval#9
Merged
fix: remove WithSchedulerInterval and use hardcoded 24h interval#9
Conversation
The scheduler interval is now fixed at 24 hours and no longer configurable. This prevents misconfiguration that could cause CPU overuse (e.g., setting interval to 0 or nanosecond values).
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves the configurable scheduler interval from the validator configuration and hardcodes the background scheduler to run at the package-level Class diagram for Config and Validator scheduler interval changesclassDiagram
class ConfigBefore {
string Root
time_Duration Interval
int FailLimit
bool ClassifyUA
}
class ConfigAfter {
string Root
int FailLimit
bool ClassifyUA
}
class ValidatorBefore {
string root
atomic_Pointer_bots bots
atomic_Pointer_uaIndex uaIndex
context_CancelFunc cancel
time_Duration interval
int failLimit
bool classifyUA
startScheduler(ctx context_Context)
}
class ValidatorAfter {
string root
atomic_Pointer_bots bots
atomic_Pointer_uaIndex uaIndex
context_CancelFunc cancel
int failLimit
bool classifyUA
startScheduler(ctx context_Context)
}
class Option {
apply(c *ConfigAfter)
}
class OptionsBefore {
WithRoot(dir string) Option
WithSchedulerInterval(interval time_Duration) Option
WithFailLimit(limit int) Option
}
class OptionsAfter {
WithRoot(dir string) Option
WithFailLimit(limit int) Option
}
ConfigBefore <|.. ConfigAfter
ValidatorBefore <|.. ValidatorAfter
Option <.. OptionsBefore
Option <.. OptionsAfter
ValidatorAfter ..> ConfigAfter
ValidatorBefore ..> ConfigBefore
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9 +/- ##
==========================================
- Coverage 75.03% 74.84% -0.20%
==========================================
Files 14 14
Lines 645 640 -5
==========================================
- Hits 484 479 -5
Misses 117 117
Partials 44 44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Benchmark Results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Remove configurable scheduler interval in favor of a fixed 24h scheduler ticker and clean up related config, validator fields, and tests.
Enhancements: