fix redis auth

This commit is contained in:
Simon Larsen 2023-02-17 12:03:12 +00:00
parent 195cd4aab4
commit 0ea65787f5
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
5 changed files with 11 additions and 7 deletions

View File

@ -1,7 +1,7 @@
import { Queue as BullQueue, JobsOptions, Job } from 'bullmq';
import { JSONObject } from 'Common/Types/JSON';
import ObjectID from 'Common/Types/ObjectID';
import { RedisHostname, RedisPort } from '../Config';
import { RedisHostname, RedisPassword, RedisPort } from '../Config';
export enum QueueName {
Workflow = 'Workflow',
@ -15,6 +15,7 @@ export default class Queue {
connection: {
host: RedisHostname.toString(),
port: RedisPort.toNumber(),
password: RedisPassword
},
});
}

View File

@ -1,5 +1,5 @@
import { Worker } from 'bullmq';
import { RedisHostname, RedisPort } from '../Config';
import { RedisHostname, RedisPassword, RedisPort } from '../Config';
import { QueueJob, QueueName } from './Queue';
export default class QueueWorker {
@ -12,6 +12,7 @@ export default class QueueWorker {
connection: {
host: RedisHostname.toString(),
port: RedisPort.toNumber(),
password: RedisPassword
},
concurrency: options.concurrency,
});

View File

@ -3,7 +3,7 @@ import BadDataException from 'Common/Types/Exception/BadDataException';
import { JSONObject } from 'Common/Types/JSON';
import ComponentMetadata, { Port } from 'Common/Types/Workflow/Component';
import ComponentID from 'Common/Types/Workflow/ComponentID';
import WebhookComponents from 'Common/Types/Workflow/Components/Webhook';
import LogComponents from 'Common/Types/Workflow/Components/Log';
import ComponentCode, { RunReturnType } from '../ComponentCode';
export default class Log extends ComponentCode {
@ -11,7 +11,7 @@ export default class Log extends ComponentCode {
super();
const LogComponent: ComponentMetadata | undefined =
WebhookComponents.find((i: ComponentMetadata) => {
LogComponents.find((i: ComponentMetadata) => {
return i.id === ComponentID.Log;
});

View File

@ -3,7 +3,7 @@ import BadDataException from 'Common/Types/Exception/BadDataException';
import ObjectID from 'Common/Types/ObjectID';
import ComponentMetadata from 'Common/Types/Workflow/Component';
import ComponentID from 'Common/Types/Workflow/ComponentID';
import WebhookComponents from 'Common/Types/Workflow/Components/Webhook';
import ScheduleComponents from 'Common/Types/Workflow/Components/Schedule';
import Workflow from 'Model/Models/Workflow';
import WorkflowService from '../../../Services/WorkflowService';
import QueryHelper from '../../Database/QueryHelper';
@ -14,7 +14,7 @@ import ComponentCode, {
export default class WebhookTrigger extends ComponentCode {
public constructor() {
const component: ComponentMetadata | undefined = WebhookComponents.find(
const component: ComponentMetadata | undefined = ScheduleComponents.find(
(i: ComponentMetadata) => {
return i.id === ComponentID.Schedule;
}

View File

@ -15,7 +15,7 @@ const APP_NAME: string = 'workflow';
const app: ExpressApplication = Express.getExpressApp();
app.use(`/`, new ComponentCode().router);
app.use(`/manual`, new ManualAPI().router);
// Job process.
@ -40,6 +40,8 @@ const init: Function = async (): Promise<void> => {
PostgresAppInstance.getDatasourceOptions()
);
app.use(`/`, new ComponentCode().router);
// connect redis
await Redis.connect();
} catch (err) {