mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix: Detect if n8n instance is staging or production for community nodes (#15918)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { CommunityNodeType } from '@n8n/api-types';
|
||||
import { Logger } from '@n8n/backend-common';
|
||||
import { Logger, inProduction } from '@n8n/backend-common';
|
||||
import { GlobalConfig } from '@n8n/config';
|
||||
import { Service } from '@n8n/di';
|
||||
import { ensureError, type INodeTypeDescription } from 'n8n-workflow';
|
||||
@@ -46,7 +46,9 @@ export class CommunityNodeTypesService {
|
||||
this.globalConfig.nodes.communityPackages.enabled &&
|
||||
this.globalConfig.nodes.communityPackages.verifiedEnabled
|
||||
) {
|
||||
const environment = this.globalConfig.license.tenantId === 1 ? 'production' : 'staging';
|
||||
// Cloud sets ENVIRONMENT to 'production' or 'staging' depending on the environment
|
||||
const environment =
|
||||
inProduction || process.env.ENVIRONMENT === 'production' ? 'production' : 'staging';
|
||||
data = await getCommunityNodeTypes(environment);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user