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

[AI][Task]16961420: fix throttleMgr incorrectly fires based on the number of days past #1981

Merged
merged 4 commits into from
Feb 1, 2023

Conversation

Karlie-777
Copy link
Contributor

@Karlie-777 Karlie-777 commented Feb 1, 2023

if (_isSpecificDaysGiven) {
dayCheck = arrIndexOf(interval.daysOfMonth, curDate.getUTCDate());
} else {
let dayInternal = _checkInterval(interval.dayInterval, date.getUTCDate(), curDate.getUTCDate());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getUTCDate() returns the date of the month, so it's not really the "interval", for example if the previous date was the 31st and today is the 2nd with an interval of 2 should cause it to fire.

I think you need to calculate the number of days between the 2 dates (if there is a last date)
Something like.
let diffDays = Math.floor(curDate.getTime() - date.getTime() / 86400000);

@Karlie-777 Karlie-777 merged commit 0562a7b into master Feb 1, 2023
@MSNev MSNev added this to the 2.8.10 milestone Feb 3, 2023
@MSNev MSNev deleted the karlie/fixthrottletest branch April 6, 2023 01:20
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.

None yet

2 participants