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

DB cluster unexpectedly scheduled up #290

Closed
lyricnz opened this issue Apr 3, 2024 · 3 comments
Closed

DB cluster unexpectedly scheduled up #290

lyricnz opened this issue Apr 3, 2024 · 3 comments

Comments

@lyricnz
Copy link
Contributor

lyricnz commented Apr 3, 2024

Using powercycleCentral with configuration of:

            - filter:
              - accountId: '554096786507'
              - id: cloudsnooze-test-rds-cluster
              - type: rdsCluster
              name: 'aws-ecp-main-workload-innovation-6: cluster DB'
              priority: 5
              schedule: Start=11:00|mon;Stop=13:00|mon

the workload was started at 11am Wednesday with the following message:

2024-04-03T00:00:00.000Z,554096786507,aws-ecp-main-workload-innovation-6,powercycleCentral,rdsCluster,rds,cloudsnooze-test-rds-cluster,start,success,"[aws-ecp-main-workload-innovation-6: cluster DB]: It's Wed 11:00 +11, availability is from 11:00 till 13:00 all week"

@lyricnz
Copy link
Contributor Author

lyricnz commented Apr 3, 2024

Looking at the regex, it looks like the day part requires both a startday and stopday

    this.re = new RegExp(`(${component}=([0-9]{1,2}:[0-9]{1,2}))(\\|([a-z]{3}-[a-z]{3}))?`);

So the schedule should read

  schedule: "Start=11:00|mon-mon;Stop=13:00|mon-mon"

Q: Why didn't this generate an error?

@lyricnz
Copy link
Contributor Author

lyricnz commented Aug 21, 2024

Single-day schedules supported by #428

@lyricnz
Copy link
Contributor Author

lyricnz commented Aug 21, 2024

It didn't fail because the regex doesn't require consuming the complete string, just a substring, and the bit at the end was ignored.

@lyricnz lyricnz closed this as completed Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant