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

Fix GetTimelineStats / GetHourlyTimelineStats incorrect order #297

Merged
merged 1 commit into from Feb 4, 2015
Merged

Fix GetTimelineStats / GetHourlyTimelineStats incorrect order #297

merged 1 commit into from Feb 4, 2015

Conversation

Dresel
Copy link

@Dresel Dresel commented Jan 31, 2015

Hi,

GetTimelineStats and GetHourlyTimelineStats job counts may be assigned to the wrong dates. The problem is that in the last loop where the result is generated the matching of the value of valuesMap[valuesMap.Keys.ElementAt(i)] and the date dates[i] are not correct.

for (var i = 0; i < dates.Count; i++)
{
    var value = valuesMap[valuesMap.Keys.ElementAt(i)]; // valuesMap.Keys may be unsorted if keys were missing and added via valuesMap.Add(key, 0);
    result.Add(dates[i], value); // dates are sorted
}

I also refactored some duplicated code into a separate function.

@odinserj
Copy link
Member

odinserj commented Feb 4, 2015

Love you! :-D Planned to 1.3.4 coming soon.

@odinserj
Copy link
Member

odinserj commented Feb 4, 2015

And thank you for switch from dev to master, this will help to release it sooner.

odinserj added a commit that referenced this pull request Feb 4, 2015
Fix GetTimelineStats / GetHourlyTimelineStats incorrect order
@odinserj odinserj merged commit 4d0e905 into HangfireIO:master Feb 4, 2015
@Dresel
Copy link
Author

Dresel commented Feb 5, 2015

I have to thank (love) you for this project - keep on :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants