Skip to content

Commit

Permalink
fix(core): Make DNS resolution order configurable (n8n-io#7272)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy authored Sep 27, 2023
1 parent e4c302c commit 5b3121c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/cli/bin/n8n
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ inspect.defaultOptions.customInspect = false;
require('express-async-errors');
require('source-map-support').install();
require('reflect-metadata');
require('dns').setDefaultResultOrder('ipv4first');

if (process.env.NODEJS_PREFER_IPV4 === 'true') {
require('dns').setDefaultResultOrder('ipv4first');
}

require('@oclif/command')
.run()
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/src/WorkflowRunnerProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import 'source-map-support/register';
import 'reflect-metadata';
import { setDefaultResultOrder } from 'dns';
setDefaultResultOrder('ipv4first');

import { Container } from 'typedi';
import type { IProcessMessage } from 'n8n-core';
Expand Down Expand Up @@ -59,6 +58,10 @@ import { License } from '@/License';
import { InternalHooks } from '@/InternalHooks';
import { PostHogClient } from '@/posthog';

if (process.env.NODEJS_PREFER_IPV4 === 'true') {
setDefaultResultOrder('ipv4first');
}

class WorkflowRunnerProcess {
data: IWorkflowExecutionDataProcessWithExecution | undefined;

Expand Down

0 comments on commit 5b3121c

Please sign in to comment.