mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-21 05:00:56 +00:00
feat(infisical-pg): completed audit log moved ee routes to normal routing pattern
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import { Job, JobsOptions, Queue, Worker, WorkerListener } from "bullmq";
|
||||
import Redis from "ioredis";
|
||||
|
||||
import { TCreateAuditLogDTO } from "@app/ee/services/audit-log/audit-log-types";
|
||||
|
||||
export enum QueueName {
|
||||
SecretRotation = "secret-rotation"
|
||||
SecretRotation = "secret-rotation",
|
||||
AuditLog = "audit-log"
|
||||
}
|
||||
|
||||
export enum QueueJobs {
|
||||
SecretRotation = "secret-rotation-job"
|
||||
SecretRotation = "secret-rotation-job",
|
||||
AuditLog = "audit-log-job"
|
||||
}
|
||||
|
||||
export type TQueueJobTypes = {
|
||||
@@ -14,6 +18,10 @@ export type TQueueJobTypes = {
|
||||
payload: { rotationId: string };
|
||||
name: QueueJobs.SecretRotation;
|
||||
};
|
||||
[QueueName.AuditLog]: {
|
||||
name: QueueJobs.AuditLog;
|
||||
payload: TCreateAuditLogDTO;
|
||||
};
|
||||
};
|
||||
|
||||
export type TQueueServiceFactory = ReturnType<typeof queueServiceFactory>;
|
||||
@@ -65,7 +73,7 @@ export const queueServiceFactory = (redisUrl: string) => {
|
||||
name: T,
|
||||
job: TQueueJobTypes[T]["name"],
|
||||
data: TQueueJobTypes[T]["payload"],
|
||||
opts: JobsOptions & { jobId: string }
|
||||
opts: JobsOptions & { jobId?: string }
|
||||
) => {
|
||||
const q = queueContainer[name];
|
||||
await q.add(job, data, opts);
|
||||
|
||||
Reference in New Issue
Block a user