/**
 * Queue configuration for run execution
 */

export interface QueueConfig {
  // Queue name
  name: string;
  
  // Retry configuration
  attempts: number;
  backoff: {
    type: 'exponential';
    delay: number; // Initial delay in ms
  };
  
  // Priority levels (higher number = higher priority)
  priorities: {
    high: number;
    normal: number;
    low: number;
  };
  
  // Job options
  removeOnComplete: {
    age: number; // Keep completed jobs for 24 hours
    count: number; // Keep last 1000 jobs
  };
  removeOnFail: {
    age: number; // Keep failed jobs for 7 days
  };
}

export const queueConfig: QueueConfig = {
  name: 'run-execution',
  attempts: 3,
  backoff: {
    type: 'exponential',
    delay: 1000, // Start with 1 second delay
  },
  priorities: {
    high: 10,
    normal: 5,
    low: 1,
  },
  removeOnComplete: {
    age: 24 * 60 * 60 * 1000, // 24 hours
    count: 1000,
  },
  removeOnFail: {
    age: 7 * 24 * 60 * 60 * 1000, // 7 days
  },
};

/**
 * Job data structure for run execution
 */
export interface RunExecutionJobData {
  runId: string;
  priority?: 'high' | 'normal' | 'low';
}

