mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Support community packages in scaling-mode (#10228)
This commit is contained in:
committed by
GitHub
parent
afa43e75f6
commit
88086a41ff
@@ -5,6 +5,7 @@ import Container from 'typedi';
|
||||
import { Logger } from 'winston';
|
||||
import { messageToRedisServiceCommandObject, debounceMessageReceiver } from '../helpers';
|
||||
import config from '@/config';
|
||||
import { CommunityPackagesService } from '@/services/communityPackages.service';
|
||||
|
||||
export async function handleCommandMessageWebhook(messageString: string) {
|
||||
const queueModeId = config.getEnv('redis.queueModeId');
|
||||
@@ -63,6 +64,20 @@ export async function handleCommandMessageWebhook(messageString: string) {
|
||||
}
|
||||
await Container.get(ExternalSecretsManager).reloadAllProviders();
|
||||
break;
|
||||
case 'community-package-install':
|
||||
case 'community-package-update':
|
||||
case 'community-package-uninstall':
|
||||
if (!debounceMessageReceiver(message, 200)) {
|
||||
return message;
|
||||
}
|
||||
const { packageName, packageVersion } = message.payload;
|
||||
const communityPackagesService = Container.get(CommunityPackagesService);
|
||||
if (message.command === 'community-package-uninstall') {
|
||||
await communityPackagesService.removeNpmPackage(packageName);
|
||||
} else {
|
||||
await communityPackagesService.installOrUpdateNpmPackage(packageName, packageVersion);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user