-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add Redis Health Check #13589
Add Redis Health Check #13589
Conversation
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
@jtkech unable to resolve service for type |
Maybe it failed to configure OrchardCore/src/OrchardCore.Modules/OrchardCore.Redis/Startup.cs Lines 42 to 55 in cc52c8d
The other Redis features check if OrchardCore/src/OrchardCore.Modules/OrchardCore.Redis/Startup.cs Lines 66 to 71 in cc52c8d
In the Hmm, but I think it's better to update Does |
This is may be a better solution but I'm not sure why it can't be retrieved from DI directly, let me check and come back to you |
See my previous comment and look at the Redis Startup to see how it is done.
|
Everything works as expected, the |
We might need to add |
@jtkech could you please have a quick review once you have time |
[RequireFeatures("OrchardCore.HealthChecks")] | ||
public class Startup : StartupBase | ||
{ | ||
public override int Order => 100; |
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.
Add a comment on why this is necessary, and what's the reason for 100
in particular.
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.
I might need to check this one, I remember this might be necessary to run the health check early
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.
So, also document what's the reason for 100 in particular. This is a magic number; can it be 90? Can it be 110? Why not 1000?
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.
Could be, no particular reason for using 10
but usually we're using 100 or more to avoid start ordering issue
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.
OK, so please document it.
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.
BTW there are many places where we use 1000 for instance without docs :)
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.
And those should have been documented as well :). Having less-than-ideal pieces of code currently doesn't mean that we should keep writing the same.
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/Startup.cs
Outdated
Show resolved
Hide resolved
[RequireFeatures("OrchardCore.HealthChecks")] | ||
public class Startup : StartupBase | ||
{ | ||
public override int Order => 100; |
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.
So, also document what's the reason for 100 in particular. This is a magic number; can it be 90? Can it be 110? Why not 1000?
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
Let's finalize the health checks PRs, so I can focus to finishing the others |
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/RedisHealthCheck.cs
Outdated
Show resolved
Hide resolved
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.
This is not addressed: https://github.com/OrchardCMS/OrchardCore/pull/13589/files#r1534675914
I already added a comment, as I said before |
Great, all clear, now add this to the comment :). |
Seems the added comment is not enough, time to modify :) |
src/OrchardCore.Modules/OrchardCore.Redis/HealthChecks/Startup.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Zoltán Lehóczky <zoltan.lehoczky@lombiq.com>
Part of #13588.