huridocs/uwazi

View on GitHub
app/api/queue.v2/infrastructure/QueueAdapter.ts

Summary

Maintainability
A
0 mins
Test Coverage
export interface Job {
  id: string;
  queue: string;
  name: string;
  params: any;
  namespace: string;
  lockedUntil: number;
  createdAt: number;
  options: {
    lockWindow: number;
  };
}

export interface QueueAdapter {
  pushJob(job: Omit<Job, 'id' | 'lockedUntil' | 'createdAt'>): Promise<string>;
  pickJob(queueName: string): Promise<Job | null>;
  renewJobLock(job: Job): Promise<void>;
  deleteJob(job: Job): Promise<void>;
}