import type { SubjectRow } from "@/worker/db/d1/schema"; import { blobGcMessage } from "@/worker/queues/blob-gc"; import { enqueueBlobGc } from "@/worker/r2/gc"; import type { AppContext } from "@/worker/types"; export async function enqueueGc( c: AppContext, subject: SubjectRow, blobs: { blobId: string; blobKey: string }[], ): Promise { await enqueueBlobGc( c.env, blobs.map((blob) => blobGcMessage({ subjectId: subject.id, storageId: subject.storageId, blobId: blob.blobId, blobKey: blob.blobKey, notBeforeMs: Date.now(), }), ), ); }