Skip to content

Commit

Permalink
feat(core): Upgrade Rudderstack SDK (no-changelog)
Browse files Browse the repository at this point in the history
This helps remove some of the older versions of transient dependencies,
like axios 0.x and ioredis 4.x.
  • Loading branch information
netroy committed Jan 26, 2024
1 parent c70fa66 commit e7bc2ac
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 208 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@n8n/permissions": "workspace:*",
"@n8n_io/license-sdk": "2.9.1",
"@oclif/core": "3.18.1",
"@rudderstack/rudder-sdk-node": "1.0.6",
"@rudderstack/rudder-sdk-node": "2.0.6",
"@sentry/integrations": "7.87.0",
"@sentry/node": "7.87.0",
"axios": "1.6.5",
Expand Down
16 changes: 4 additions & 12 deletions packages/cli/src/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class Telemetry {
const logLevel = config.getEnv('logs.level');

const { default: RudderStack } = await import('@rudderstack/rudder-sdk-node');
this.rudderStack = new RudderStack(key, url, { logLevel });
this.rudderStack = new RudderStack(key, { logLevel, dataPlaneUrl: url });

this.startPulse();
}
Expand Down Expand Up @@ -154,16 +154,8 @@ export class Telemetry {

async trackN8nStop(): Promise<void> {
clearInterval(this.pulseIntervalReference);
void this.track('User instance stopped');
return await new Promise<void>(async (resolve) => {
await this.postHog.stop();

if (this.rudderStack) {
this.rudderStack.flush(resolve);
} else {
resolve();
}
});
await this.track('User instance stopped');
void Promise.all([this.postHog.stop(), this.rudderStack?.flush()]);
}

async identify(traits?: {
Expand Down Expand Up @@ -194,7 +186,7 @@ export class Telemetry {
return await new Promise<void>((resolve) => {
if (this.rudderStack) {
const { user_id } = properties;
const updatedProperties: ITelemetryTrackProperties = {
const updatedProperties = {
...properties,
instance_id: instanceId,
version_cli: N8N_VERSION,
Expand Down
Loading

0 comments on commit e7bc2ac

Please sign in to comment.