Files
n8n-enterprise-unlocked/packages/cli/src/controllers/orchestration.controller.ts
T
Michael Auerswald 9f797b96d8 feat(core): Add command to trigger license refresh on workers (#7184)
This PR implements the updated license SDK so that worker and webhook
instances do not auto-renew licenses any more.

Instead, they receive a `reloadLicense` command via the Redis client
that will fetch the updated license after it was saved on the main
instance

This also contains some refactoring with moving redis sub and pub
clients into the event bus directly, to prevent cyclic dependency
issues.
2023-09-17 11:05:54 +02:00

33 lines
1.0 KiB
TypeScript

import { Authorized, Get, RestController } from '@/decorators';
import { OrchestrationRequest } from '@/requests';
import { Service } from 'typedi';
import { OrchestrationService } from '@/services/orchestration.service';
@Authorized(['global', 'owner'])
@RestController('/orchestration')
@Service()
export class OrchestrationController {
constructor(private readonly orchestrationService: OrchestrationService) {}
/**
* These endpoint currently do not return anything, they just trigger the messsage to
* the workers to respond on Redis with their status.
* TODO: these responses need to be forwarded to and handled by the frontend
*/
@Get('/worker/status/:id')
async getWorkersStatus(req: OrchestrationRequest.Get) {
const id = req.params.id;
return this.orchestrationService.getWorkerStatus(id);
}
@Get('/worker/status')
async getWorkersStatusAll() {
return this.orchestrationService.getWorkerStatus();
}
@Get('/worker/ids')
async getWorkerIdsAll() {
return this.orchestrationService.getWorkerIds();
}
}