Skip to content
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

.NET crontab syntax for every 2nd hour doesn't work #3719

Open
tobiasosterblom opened this issue Oct 30, 2024 · 1 comment
Open

.NET crontab syntax for every 2nd hour doesn't work #3719

tobiasosterblom opened this issue Oct 30, 2024 · 1 comment

Comments

@tobiasosterblom
Copy link

Package

Sentry

.NET Flavor

.NET

.NET Version

8

OS

Windows

SDK Version

4.12.1

Self-Hosted Sentry Version

24.10.0

Steps to Reproduce

When using the API to set interval we aren't allowed to use the syntax for every 2nd hour (0 */2 * * *). Alltough when we are entering this in the web-UI it seems to be allowed (and the tooltip displays the correct interpretation).
Image

Expected Result

To be allowed to use the SetInterval method with a slash / sign to be able to configure the cron programmatically .
E.g.

        private void ConfigureOptions(SentryMonitorOptions options)
        {
            options.Interval("0 */2 * * *"); // <-- this throws an error
            options.CheckInMargin = TimeSpan.FromMinutes(10);
            options.FailureIssueThreshold = 1;
        }

Actual Result

Exception:
System.ArgumentException: 'The provided crontab does not match the expected format of '* * * * *' translating to 'minute', 'hour', 'day of the month', 'month', and 'day of the week'.'

I suspect that the regex needs some tweaking here.

@bruno-garcia
Copy link
Member

@bitsandfoxes any tips here on the crons side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: No status
Development

No branches or pull requests

2 participants