Spaces:
Sleeping
Sleeping
Download apps/api/src/scraper/scrapeURL/engines/fire-engine/delete.ts from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 767 Bytes
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/scraper/scrapeURL/engines/fire-engine/delete.ts
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/api/src/scraper/scrapeURL/engines/fire-engine/delete.ts
-
curl -L -o delete.ts https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/scraper/scrapeURL/engines/fire-engine/delete.ts
767 Bytes
| import { Logger } from "winston"; | |
| import { robustFetch } from "../../lib/fetch"; | |
| import { MockState } from "../../lib/mock"; | |
| import { fireEngineURL } from "./scrape"; | |
| export async function fireEngineDelete( | |
| logger: Logger, | |
| jobId: string | undefined, | |
| mock: MockState | null, | |
| abort?: AbortSignal, | |
| baseUrl: string = fireEngineURL, | |
| ) { | |
| // jobId only supplied if we need to defer deletion | |
| if (!jobId) { | |
| logger.debug("Fire Engine job id not supplied, skipping delete"); | |
| return; | |
| } | |
| await robustFetch({ | |
| url: `${baseUrl}/scrape/${jobId}`, | |
| method: "DELETE", | |
| headers: {}, | |
| logger: logger.child({ method: "fireEngineDelete/robustFetch", jobId }), | |
| mock, | |
| abort, | |
| }); | |
| logger.debug("Deleted job from Fire Engine", { jobId }); | |
| } | |