-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
HostingBackgroundService should wait for StorageInitialized #3333
HostingBackgroundService should wait for StorageInitialized #3333
Conversation
{ | ||
EnsureArg.IsNotNull(jobFactories, nameof(jobFactories)); | ||
|
||
_jobFactoryLookup = new Dictionary<int, Func<IJob>>(); | ||
|
||
foreach (Func<IJob> jobFunc in jobFactories) | ||
{ | ||
var instance = jobFunc.Invoke(); | ||
if (instance.GetType().GetCustomAttribute(typeof(JobTypeIdAttribute), false) is JobTypeIdAttribute jobTypeAttr) | ||
try |
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.
Why wrap this in a try/catch here? This looks like it would allow the JobFactory to be created successfully without all of the job types successfully added. This should be caught during testing as the affected job type wouldn't run, but I don't see why we would want this to succeed if there are broken job types.
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.
What I found was, the Queues determine the job types that are needed, Job Types can be registered that aren't used. In this examples Import was in core and registered, but this isn't ever used by a Cosmos instance. Stands to reason that if it is registered is should function, I'll change this to a throw
fc44b6c
to
4cd2169
Compare
4cd2169
to
27bb0ce
Compare
Description
HostingBackgroundService should wait for StorageInitializedNotification, jobs that require QueueClient (all) or any data access should respect this. This allows all job tasks to inherit this behavior.
@PTaladay, @LTA-Thinking
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)