diff options
author | Pavel Bashkirov <pavel@nebius.com> | 2025-06-26 12:44:04 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2025-06-26 12:57:52 +0300 |
commit | 0b47b15628153922f04000ad1219c3e0df829385 (patch) | |
tree | 1b6dc9a984a2d1cc9dfc2513a7e9c6721a137b38 /library/cpp/cron_expression/cron_expression.h | |
parent | eb4cc660850b42db63b573cb25a6fdd36d4d508d (diff) | |
download | ydb-0b47b15628153922f04000ad1219c3e0df829385.tar.gz |
Use CRON to set the schedule of queues export
# Description
Currently the interval of queues export can only be set as "Every N units". This sometimes does not work well as it always starts the count from the time `0` (January 1st, 1970). It means that, for instance, if the customer wants to set an export to "Every week", it will happen every Thursday.
This PR fixes the problem by providing a CRON way to set the schedule which is proven to be very flexible and meeting (almost) any requirement the user may have.
* Changelog entry
Type: feature
Component: queue-agent
Support CRON schedules for queue exports.
---
Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1239
Co-authored-by: apachee <apachee@yandex-team.com>
Co-authored-by: apachee <apachee@yandex-team.com>
Co-authored-by: apachee <apachee@yandex-team.com>
Co-authored-by: apachee <apachee@yandex-team.com>
Co-authored-by: apachee <apachee@yandex-team.com>
commit_hash:6a536f5edc17b3ad8d2243d55d876994141d38b0
Diffstat (limited to 'library/cpp/cron_expression/cron_expression.h')
-rw-r--r-- | library/cpp/cron_expression/cron_expression.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/library/cpp/cron_expression/cron_expression.h b/library/cpp/cron_expression/cron_expression.h new file mode 100644 index 00000000000..2b51a72957d --- /dev/null +++ b/library/cpp/cron_expression/cron_expression.h @@ -0,0 +1,16 @@ +#pragma once + +#include <library/cpp/timezone_conversion/civil.h> + +class TCronExpression { +public: + TCronExpression(const TStringBuf cronUnparsedExpr); + ~TCronExpression(); + + NDatetime::TCivilSecond CronNext(NDatetime::TCivilSecond date); + NDatetime::TCivilSecond CronPrev(NDatetime::TCivilSecond date); + +private: + class TImpl; + THolder<TImpl> Impl; +}; |