Skip to content

Commit 4b0f581

Browse files
tiny fixes and linting
1 parent 31fa75c commit 4b0f581

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

react_on_rails_pro/docs/node-renderer/js-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Here are the options available for the JavaScript renderer configuration object,
2222
If no password is set, no authentication will be required.
2323
1. **allWorkersRestartInterval** (default: `env.RENDERER_ALL_WORKERS_RESTART_INTERVAL`) - Interval in minutes between scheduled restarts of all workers. By default restarts are not enabled. If restarts are enabled, `delayBetweenIndividualWorkerRestarts` should also be set.
2424
1. **delayBetweenIndividualWorkerRestarts** (default: `env.RENDERER_DELAY_BETWEEN_INDIVIDUAL_WORKER_RESTARTS`) - Interval in minutes between individual worker restarts (when cluster restart is triggered). By default restarts are not enabled. If restarts are enabled, `allWorkersRestartInterval` should also be set.
25-
1. **gracefulWorkerRestartTimeout**: (default: `env.GRACEFUL_WORKER_RESTART_TIMEOUT`) - Time in seconds that master waits for worker to gracefully restart (after serving all active requests) before killing it. You need to use this config to avoid situations where worker stucks at an inifite loop and doesn't restart. This config is only usable if worker restart is enabled. This time is counted starting from the time when should the worker restart, if that timeout value passed without restarting the worker, the worker is killed.
25+
1. **gracefulWorkerRestartTimeout**: (default: `env.GRACEFUL_WORKER_RESTART_TIMEOUT`) - Time in seconds that the master waits for a worker to gracefully restart (after serving all active requests) before killing it. Use this when you want to avoid situations where a worker gets stuck in an infinite loop and never restarts. This config is only usable if worker restart is enabled. The timeout starts when the worker should restart; if it elapses without a restart, the worker is killed.
2626
1. **maxDebugSnippetLength** (default: 1000) - If the rendering request is longer than this, it will be truncated in exception and logging messages.
2727
1. **supportModules** - (default: `env.RENDERER_SUPPORT_MODULES || null`) - If set to true, `supportModules` enables the server-bundle code to call a default set of NodeJS global objects and functions that get added to the VM context:
2828
`{ Buffer, TextDecoder, TextEncoder, URLSearchParams, ReadableStream, process, setTimeout, setInterval, setImmediate, clearTimeout, clearInterval, clearImmediate, queueMicrotask }`.

react_on_rails_pro/lib/react_on_rails_pro/request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def connection_without_retries
9999
def perform_request(path, **post_options) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
100100
# For streaming requests, use connection without retries to prevent body duplication
101101
# The StreamRequest class handles retries properly by starting fresh requests
102-
conn = connection
102+
conn = post_options[:stream] ? connection_without_retries : connection
103103

104104
available_retries = ReactOnRailsPro.configuration.renderer_request_retry_limit
105105
retry_request = true

react_on_rails_pro/packages/node-renderer/src/master/restartWorkers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ export = async function restartWorkers(
2424
if (!cluster.workers) {
2525
throw new Error('No workers to restart');
2626
}
27-
for (const worker of Object.values(cluster.workers)) {
28-
if (!worker) return;
27+
for (const worker of Object.values(cluster.workers).filter((w) => !!w)) {
2928
log.debug('Kill worker #%d', worker.id);
3029
worker.isScheduledRestart = true;
3130

react_on_rails_pro/spec/dummy/spec/system/integration_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def change_text_expect_dom_selector(dom_selector, expect_no_change: false)
403403
it "renders the page completely on server and displays content on client even without JavaScript" do
404404
# Don't add client-bundle.js to the page to ensure that the app is not hydrated
405405
visit "#{path}?skip_js_packs=true"
406-
expect(page.html).not_to include("client-bundle.js")
406+
expect(page.html).not_to match(/client-bundle[^\"]*.js/)
407407
# Ensure that the component state is not updated
408408
change_text_expect_dom_selector(selector, expect_no_change: true)
409409

0 commit comments

Comments
 (0)