-
Notifications
You must be signed in to change notification settings - Fork 40
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
feat: add extra time that prevents from instantly suspending out of quota kafkas #1716
base: main
Are you sure you want to change the base?
Conversation
@@ -440,7 +440,7 @@ func (k *KafkaManager) updateExpiresAtBasedOnQuotaEntitlement(kafka *dbapi.Kafka | |||
} | |||
|
|||
// set expires_at to now + grace period days |
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.
the comment needs to be updated as well?
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.
yes. I will update it. I also need to add code to remove expiration if quota is now > 0
@@ -440,7 +440,7 @@ func (k *KafkaManager) updateExpiresAtBasedOnQuotaEntitlement(kafka *dbapi.Kafka | |||
} | |||
|
|||
// set expires_at to now + grace period days | |||
expiresAtTime := time.Now().AddDate(0, 0, billingModel.GracePeriodDays) | |||
expiresAtTime := time.Now().AddDate(0, 0, billingModel.GracePeriodDays).Add(time.Hour * 12) |
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.
Just a question for my understanding: How was the 12 hours period choosen? And how is it different to grace period?
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.
it was jus an arbitrary number of hours, so kafkas won't be instantly suspended if allowed quota intermittently shows 0
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.
Thanks for the clarification. Might be good to extract the "magic" number onto a const/variable with a proper name and comment if possible.
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.
makes sense. will do that
feat: add extra time that prevents from instantly suspending out of quota kafkas
Description
Verification Steps
Checklist (Definition of Done)