feat(core): Support community packages in scaling-mode (#10228)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-08-05 11:52:06 +02:00
committed by GitHub
parent afa43e75f6
commit 88086a41ff
19 changed files with 187 additions and 129 deletions
@@ -10,6 +10,7 @@ import { Push } from '@/push';
import { TestWebhooks } from '@/TestWebhooks';
import { OrchestrationService } from '@/services/orchestration.service';
import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
import { CommunityPackagesService } from '@/services/communityPackages.service';
// eslint-disable-next-line complexity
export async function handleCommandMessageMain(messageString: string) {
@@ -77,6 +78,20 @@ export async function handleCommandMessageMain(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;
case 'add-webhooks-triggers-and-pollers': {
if (!debounceMessageReceiver(message, 100)) {