n8n/packages/cli/src/services/redis/RedisServiceCommands.ts
Michael Auerswald 3cad60e918
feat(core): Make Redis available for backend communication (#6719)
* support redis cluster

* cleanup, fix config schema

* set default prefix to bull

* initial commit

* improve logging

* improve types and refactor

* list support and refactor

* fix redis service and tests

* add comment

* add redis and cache prefix

* use injection

* lint fix

* clean schema comments

* improve naming, tests, cluster client

* merge master

* cache returns unknown instead of T

* update cache service, tests and doc

* remove console.log

* do not cache null or undefined values

* fix merge

* lint fix
2023-08-02 12:51:25 +02:00

23 lines
781 B
TypeScript

export type RedisServiceCommand = 'getStatus' | 'restartEventBus' | 'stopWorker'; // TODO: add more commands
/**
* An object to be sent via Redis pub/sub from the main process to the workers.
* @field command: The command to be executed.
* @field targets: The targets to execute the command on. Leave empty to execute on all workers or specify worker ids.
* @field args: Optional arguments to be passed to the command.
*/
type RedisServiceBaseCommand = {
command: RedisServiceCommand;
payload?: {
[key: string]: string | number | boolean | string[] | number[] | boolean[];
};
};
export type RedisServiceWorkerResponseObject = {
workerId: string;
} & RedisServiceBaseCommand;
export type RedisServiceCommandObject = {
targets?: string[];
} & RedisServiceBaseCommand;