Skip to content

Conversation

@wimdows-nl
Copy link

@wimdows-nl wimdows-nl commented Feb 28, 2017

...to allow more course grained control over the number of transaction commits/updates being performed especially with loops > 1000 iterations, as this will result in 1000 (100/0.1 percentage steps) tx commits. On low resource (1 core, SQL Express) cloud computing instances this can lead to Hangfire not getting the heartbeat response within timeout, causing jobs to be abandoned and restarted.

…rained control over the number of transaction commits/updates being performed especially with loops > 1000 iterations, as this will result in 1000 tx commits. On low resource cloud computing instances this can lead to Hangfire not getting heartbeat response within timeout, causing jobs to be abandoned and restarted.
_count = count;
_index = -1;
_percentageIncrementStep = percentageIncrementStep;
_segmentThreshold = (int)((_percentageIncrementStep / 100.0) * _count);
Copy link
Owner

Choose a reason for hiding this comment

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

It is incorrect to pre-calc it here, as _count may change during enumeration

Copy link
Author

Choose a reason for hiding this comment

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

Good point, will add to the PR.

_count = count;
_index = -1;
_percentageIncrementStep = percentageIncrementStep;
_segmentThreshold = (int)((_percentageIncrementStep / 100.0) * _count);
Copy link
Owner

Choose a reason for hiding this comment

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

It is incorrect to pre-calc it here, as _count may change during enumeration

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.

2 participants