Skip to content

chore: update logs + add parallel.for when putting updating tiles to S3#112

Open
asafMasa wants to merge 8 commits intomasterfrom
tryFixAsync
Open

chore: update logs + add parallel.for when putting updating tiles to S3#112
asafMasa wants to merge 8 commits intomasterfrom
tryFixAsync

Conversation

@asafMasa
Copy link
Contributor

@asafMasa asafMasa commented Aug 2, 2023

Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

Update logs
Fix version in logs
Add parallel for when putting updating tiles to S3

@asafMasa asafMasa changed the title chore: update logs chore: update logs + add parallel.for when putting updating tiles to S3 Aug 2, 2023
@shimoncohen shimoncohen added the enhancement New feature or request label Aug 3, 2023
{
this._logger.LogDebug($"[{MethodBase.GetCurrentMethod().Name}] start");
List<int> zoomLevels = new List<int>();
List<int> zoomLevels = new List<int>(Data<IS3Client>.MaxZoomRead);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the capacity, it is not nessecary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why? isn't it good practice to put list limit?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think that it is nessecary in this case when we are dealing with small numbers.
If anything, in most cases this will be too much, we will have less zoom levels with the array capacity being 25 (currently).
This also may be a issue if the value is accidently changed to be a smaller value than the amount of zoom levels in a certain data type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's best practice - and we try to stick to best practices
https://stackoverflow.com/questions/25429652/c-sharp-what-is-listt-initial-capacity-used-for
smaller values

{
"GENERAL": {
"validate": false,
"defaultConnectionLimit": 100,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What kind of connection limit? For what? Depending on the answer, this may not be the correct place for this type of configuration.
Remove the 'default' prefix.
In addition, this configuration is not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed to servicePointManagerDefaultConnectionLimit


private async void ParallelUpdateTiles(IEnumerable<Tile> targetTiles)
{
await Parallel.ForEachAsync(targetTiles, new ParallelOptions { MaxDegreeOfParallelism = 50 }, async (tile, cancellationToken) =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is there a '50' hard coded here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed to -1
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

This was not the question... Why is there a hard coded value here? Why is this not configureable?
In addition, this should be thoroughly checked before being pushed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because i think we will never change it...
i'll show you the test results

@shimoncohen
Copy link
Collaborator

Please thoroughly check the changes you made.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants