-
Notifications
You must be signed in to change notification settings - Fork 26
feat: configurable minimum crank frequency #717
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
Open
Dodecahedr0x
wants to merge
18
commits into
master
Choose a base branch
from
dode/configurable-min-frequency
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
21899bf
feat: configurable minimum crank frequency
Dodecahedr0x d47718c
Merge branch 'master' into dode/configurable-min-frequency
Dodecahedr0x cdba8bc
refactor: rename to interval
Dodecahedr0x 1850af0
feat: don't crank invalid commit freq
Dodecahedr0x a0c22de
feat: cache interval
Dodecahedr0x 895b549
feat: use atomic i64
Dodecahedr0x 4f66572
Merge branch 'master' into dode/configurable-min-frequency
Dodecahedr0x b7bf76c
fix: tests
Dodecahedr0x 2091581
feat: use humantime for config
Dodecahedr0x 83671b8
fix: tests
Dodecahedr0x 535e5e5
syle: don't use constant
Dodecahedr0x b80730f
docs: update config comment
Dodecahedr0x ca634ac
docs: update help doc
Dodecahedr0x 81853ac
feat: disable commit frequencies below u32::MAX
Dodecahedr0x da7dcf4
chore: update toolchain and fix clippy (#708)
bmuddha 7bbc0dd
feat: move checks to the task service
Dodecahedr0x 9a2424b
Merge branch 'master' into dode/configurable-min-frequency
Dodecahedr0x 79e928b
Merge branch 'master' into dode/configurable-min-frequency
Dodecahedr0x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,28 @@ | ||
| use std::time::Duration; | ||
|
|
||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| use crate::consts; | ||
|
|
||
| /// Configuration for the internal task scheduler. | ||
| #[derive(Deserialize, Serialize, Debug, Clone, Default)] | ||
| #[derive(Deserialize, Serialize, Debug, Clone)] | ||
| #[serde(rename_all = "kebab-case", deny_unknown_fields, default)] | ||
| pub struct TaskSchedulerConfig { | ||
| /// If true, clears all pending scheduled tasks on startup. | ||
| pub reset: bool, | ||
| /// The minimum interval between task executions. | ||
| /// Supports humantime (e.g. "10ms", "1s"). | ||
| #[serde(with = "humantime")] | ||
| pub min_interval: Duration, | ||
| } | ||
|
|
||
| impl Default for TaskSchedulerConfig { | ||
| fn default() -> Self { | ||
| Self { | ||
| reset: false, | ||
| min_interval: Duration::from_millis( | ||
| consts::DEFAULT_TASK_SCHEDULER_MIN_INTERVAL_MILLIS, | ||
| ), | ||
| } | ||
| } | ||
| } |
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still needed?