Download src/rendering/queue/processors/video-processor-utils.ts from Bin29/ManimCat: direct link, hf CLI and curl.
- Browser
- Download file 996 Bytes
-
https://huggingface.co/spaces/Bin29/ManimCat/resolve/main/src/rendering/queue/processors/video-processor-utils.ts
- Command line
-
hf download hf://spaces/Bin29/ManimCat/src/rendering/queue/processors/video-processor-utils.ts
-
curl -L -o video-processor-utils.ts https://huggingface.co/spaces/Bin29/ManimCat/resolve/main/src/rendering/queue/processors/video-processor-utils.ts
996 Bytes
| import type { ProcessingStage } from '../../../types' | |
| export function shouldDisableQueueRetry(errorMessage: string): boolean { | |
| return errorMessage.includes('Code retry failed after') | |
| || errorMessage.includes('AI retry skipped for') | |
| } | |
| export function getRetryMeta(job: any): { | |
| currentAttempt: number | |
| maxAttempts: number | |
| hasRemainingAttempts: boolean | |
| } { | |
| const maxAttempts = typeof job?.opts?.attempts === 'number' && job.opts.attempts > 0 ? job.opts.attempts : 1 | |
| const currentAttempt = (job?.attemptsMade ?? 0) + 1 | |
| return { | |
| currentAttempt, | |
| maxAttempts, | |
| hasRemainingAttempts: currentAttempt < maxAttempts | |
| } | |
| } | |
| export async function storeProcessingStage( | |
| jobId: string, | |
| stage: ProcessingStage, | |
| options?: { | |
| status?: 'queued' | 'processing' | |
| attempt?: number | |
| submittedAt?: string | |
| } | |
| ): Promise<void> { | |
| const { storeJobStage } = await import('../../../infrastructure/redis/job/redis-job-state-store') | |
| await storeJobStage(jobId, stage, options) | |
| } | |