You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thereadinesscheckusuallyperformsamoreextensiveandtime-consumingsetofcheckstodetermineifalloftheapp'ssubsystemsandresourcesareavailable. Alivenesscheckmerelyperformsaquickchecktodetermineiftheappisavailabletoprocessrequests. Aftertheapppassesitsreadinesscheck, there's no need to burden the app further with the expensive set of readiness checks—further checks only require checking for liveness.
437
+
Considerthefollowingexample:Anappmustdownloadalargeconfigurationfilebeforeit's ready to process requests. We don'twanttheapptoberestartediftheinitialdownloadfailsbecausetheappcanretrydownloadingthefileseveraltimes. Weusea*livenessprobe*todescribethelivenessoftheprocess, noadditionalchecksareperformed. Wealsowanttopreventrequestsfrombeingsenttotheappbeforetheconfigurationfiledownloadhassucceeded. Weusea*readinessprobe*toindicatea"not ready"stateuntilthedownloadsucceedsandtheappisreadytoreceiverequests.
438
438
439
439
Thesampleappcontainsahealthchecktoreportthecompletionoflong-runningstartuptaskina [HostedService](xref:fundamentals/host/hosted-services). The `StartupHostedServiceHealthCheck` exposesaproperty, `StartupTaskCompleted`, thatthehostedservicecansetto `true` whenitslong-runningtaskisfinished (*StartupHostedServiceHealthCheck.cs*):
Thereadinesscheckusuallyperformsamoreextensiveandtime-consumingsetofcheckstodetermineifalloftheapp'ssubsystemsandresourcesareavailable. Alivenesscheckmerelyperformsaquickchecktodetermineiftheappisavailabletoprocessrequests. Aftertheapppassesitsreadinesscheck, there's no need to burden the app further with the expensive set of readiness checks—further checks only require checking for liveness.
1150
+
Considerthefollowingexample:Anappmustdownloadalargeconfigurationfilebeforeit's ready to process requests. We don'twanttheapptoberestartediftheinitialdownloadfailsbecausetheappcanretrydownloadingthefileseveraltimes. Weusea*livenessprobe*todescribethelivenessoftheprocess, noadditionalchecksareperformed. Wealsowanttopreventrequestsfrombeingsenttotheappbeforetheconfigurationfiledownloadhassucceeded. Weusea*readinessprobe*toindicatea"not ready"stateuntilthedownloadsucceedsandtheappisreadytoreceiverequests.
1151
1151
1152
1152
Thesampleappcontainsahealthchecktoreportthecompletionoflong-runningstartuptaskina [HostedService](xref:fundamentals/host/hosted-services). The `StartupHostedServiceHealthCheck` exposesaproperty, `StartupTaskCompleted`, thatthehostedservicecansetto `true` whenitslong-runningtaskisfinished (*StartupHostedServiceHealthCheck.cs*):
0 commit comments