-
Notifications
You must be signed in to change notification settings - Fork 189
JS-771 Support extra Sonar property for timeout of node bridge #5470
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
Conversation
server.mjs
Outdated
const timeoutSeconds = | ||
timeoutArg !== undefined && !isNaN(Number(timeoutArg)) ? Number(timeoutArg) : undefined; |
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.
const timeoutSeconds = | |
timeoutArg !== undefined && !isNaN(Number(timeoutArg)) ? Number(timeoutArg) : undefined; | |
const timeoutSeconds = Number.parseInt(timeoutArg) || undefined; |
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.
forget about this, 0 needs to be supported
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.
just a small simplification
can you test in SonarLint pls before merging? kill IDE and node should stay forever in background
public static int getNodeTimeoutSeconds(Configuration config) { | ||
return config.getInt(NODE_TIMEOUT_PROPERTY).orElse(DEFAULT_TIMEOUT_SECONDS); | ||
} | ||
|
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 would rather have all these helper function to get properties to JsTsContext.java
private final BridgeServerImpl bridge; | ||
|
||
public StandaloneParser() { | ||
this(Http.getJdkHttpClient()); |
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 think we need to check with security about this change. Why was it needed in the first place.
public static final String SONARJS_EXISTING_NODE_PROCESS_PORT = | ||
"SONARJS_EXISTING_NODE_PROCESS_PORT"; | ||
private static final Gson GSON = new Gson(); | ||
private static final String BRIDGE_DEPLOY_LOCATION = "bridge-bundle"; | ||
|
||
private final NodeCommandBuilder nodeCommandBuilder; | ||
private final int timeoutSeconds; | ||
private int timeoutSeconds = DEFAULT_TIMEOUT_SECONDS; |
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.
revert back and use different variables for request timeouts and node timeout
|
JS-771