-
Notifications
You must be signed in to change notification settings - Fork 334
Add timepoint to periodic task settings. #913
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
base: develop
Are you sure you want to change the base?
Conversation
6731cd2
to
ed36286
Compare
ed36286
to
b6ee85c
Compare
b6ee85c
to
e39b5f0
Compare
@@ -62,6 +62,15 @@ class PeriodicTask final { | |||
|
|||
/// Configuration parameters for PeriodicTask. | |||
struct Settings final { | |||
struct TimePoint { | |||
std::uint8_t hour; | |||
std::uint8_t minute; |
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.
если есть что-то про время, должно быть и про таймзону
@@ -62,6 +62,15 @@ class PeriodicTask final { | |||
|
|||
/// Configuration parameters for PeriodicTask. | |||
struct Settings final { | |||
struct TimePoint { | |||
std::uint8_t hour; | |||
std::uint8_t minute; |
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.
лучше инициализировать нулями, чем оставлять мусорные значения
@@ -110,6 +125,10 @@ class PeriodicTask final { | |||
/// `(period +/- distribution) - time of previous execution` | |||
std::chrono::milliseconds distribution{}; | |||
|
|||
/// @brief Time point for the task execution. Task is repeated every | |||
/// hour:minute UTC of the current/next day | |||
std::optional<TimePoint> strong_mode_anchor; |
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.
как-то костыльненько выглядит
у нас есть параметры внутри Settings, и тут они частично переопределяются
лучше написать отдельный класс, который работает по расписанию и не обладает инвариантами PeriodicTask
e39b5f0
to
248e505
Compare
Relates #895
Note: by creating a PR or an issue you automatically agree to the CLA. See CONTRIBUTING.md. Feel free to remove this note, the agreement holds.