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

made RepositoriesIndexUpdate Obsolete and added logic in runjob to se… #43

Merged
merged 3 commits into from
May 31, 2024

Conversation

MatthiasSort
Copy link
Contributor

…t the job.RepositoriesIndexSettings if the provider has values in RepositoriesIndexUpdate. changed TargetGramework to net8.0 and bump version to 10.5.0 to match DataIntegration and Ecommerce

…t the job.RepositoriesIndexSettings if the provider has values in RepositoriesIndexUpdate. changed TargetGramework to net8.0 and bump version to 10.5.0 to match DataIntegration and Ecommerce
src/DynamicwebProvider.cs Outdated Show resolved Hide resolved
job.RepositoriesIndexSettings = new RepositoriesIndexSettings(new Collection<string>([.. RepositoriesIndexUpdate.Split(separator, StringSplitOptions.RemoveEmptyEntries)]));
}
RepositoriesIndexUpdate = string.Empty;
job.Save();
Copy link
Contributor

Choose a reason for hiding this comment

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

the Save operation of the job during the job running is not a good way to do it as it can lead to unpredictlable fail so the job execution can fail due to that so we need to think where to move it better

Copy link
Contributor

Choose a reason for hiding this comment

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

have not found how to make it perfect, but I suggest this:

  1. Make a new method for those lines:

if (!string.IsNullOrEmpty(RepositoriesIndexUpdate))
           if (job.RepositoriesIndexSettings?.RepositoriesIndexes?.Count == 0)
           {
               job.RepositoriesIndexSettings = new RepositoriesIndexSettings(new Collection([.. RepositoriesIndexUpdate.Split(separator, StringSplitOptions.RemoveEmptyEntries)]));
           }
           RepositoriesIndexUpdate = string.Empty;
           job.Save();
       }

  1. call it at the end of RunJob() method in the provider:

so after this line: AssortmentHandler?.RebuildAssortments();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

like this? :)

@MatthiasSort MatthiasSort requested a review from DWDBE May 31, 2024 08:32
@MatthiasSort MatthiasSort requested a review from frederik5480 May 31, 2024 11:55
@frederik5480 frederik5480 merged commit e0dd7a5 into main May 31, 2024
1 check passed
@frederik5480 frederik5480 deleted the mss/19485-RepositoriesIndex branch May 31, 2024 12:00
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.

3 participants