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

Add calendar limit #32

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add calendar limit #32

wants to merge 5 commits into from

Conversation

scrungus
Copy link
Contributor

This probably needs a sanity check as it was rushed but seems to work.

This PR:

  • adds a config section for quota settings
  • enforces quota limits if enabled, where the quota for a period (default is 'week') is defined as quota_period * daily_average * usage_limit.
  • adds unit tests which cover the following cases:

PASS:

  • 'front loaded' prexisting light reservation
  • 'back loaded' prexisting light reservation
    FAIL:
  • 'front loaded' prexisting heavy reservation
  • 'back loaded' prexisting heavy reservation

front and back loaded refers to whether the reservation starts before the quota period or finishes afterwards. we test this because we want to make sure we are only counting the proportion of the reservation within the current quota period towards the quota limit.

light vs heavy reservation refers to whether the reservation is small or large enough that it either prevents or allows a new reservation.

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

Successfully merging this pull request may close these issues.

1 participant