-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
…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
job.RepositoriesIndexSettings = new RepositoriesIndexSettings(new Collection<string>([.. RepositoriesIndexUpdate.Split(separator, StringSplitOptions.RemoveEmptyEntries)])); | ||
} | ||
RepositoriesIndexUpdate = string.Empty; | ||
job.Save(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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:
- 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();
}
- call it at the end of RunJob() method in the provider:
so after this line: AssortmentHandler?.RebuildAssortments();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like this? :)
…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