-
Notifications
You must be signed in to change notification settings - Fork 521
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
Make blockedThreadDetectionEnabled configurable via a system property #3567
Make blockedThreadDetectionEnabled configurable via a system property #3567
Conversation
protected def blockedThreadDetectionEnabled: Boolean = | ||
Option(System.getProperty("cats.effect.detectBlockedThreads")).map(_.toLowerCase()) match { | ||
case Some(value) => value.equalsIgnoreCase("true") | ||
case None => false // default to disabled | ||
} |
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 wonder if we simplify this with java.lang.Boolean.getBoolean
method.
https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html#getBoolean-java.lang.String-
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.
It looks like using getBoolean
would indeed be simpler. Updating the branch.
@@ -25,6 +25,7 @@ This can be done for example with the [EnvironmentPlugin for Webpack](https://we | |||
|
|||
| System Property (JVM) / ENV Variable (JS) | Value (default) | Description | | |||
|---------------------------------------------------------------------------------------------------|--------------------|-----------------------------------------------------------------------------------------------------------------------------------| | |||
| `cats.effect.detectBlockedThreads` <br/> N/A | `Boolean` (`false`) | Whether or not we should detect blocked threads. | |
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.
👍
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.
Thanks for the PR!
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.
LGTM, thank you for your contribution!
Resolves #3561.