space.schedule.delete()
Delete a job and all its runs.
Deletes a job and all its runs. This cannot be undone.
delete(id: string, options?: CallOptions): Promise<void>Parameters
idstringThe job’s ID: 26 lowercase letters and digits.
options.signalAbortSignalCancels the call.
options.timeoutMsnumberHow long the call may take, in milliseconds. The
timeoutMsset increateSpacewhen you leave it out, 30,000 by default.
Returns
A promise that settles with nothing once the job is deleted. To stop a job for a while and keep its history, pause it instead.
The call is sent again, up to retries times, when it fails in a way that may pass, such as a network failure or 503. A job deleted by an earlier try then gives not_found.
Errors
| Code | When |
|---|---|
validation_failed | id is not a job ID |
not_found | The project has no job with that ID |
Every call can also fail with the codes shared by all of space, such as missing_project or network_error. See SpaceError.
Example
import { space, SpaceError } from "digitospace"
try {
await space.schedule.delete("01m3c081d2wj4g63qcr53pa1yh")
} catch (error) {
if (!(error instanceof SpaceError && error.code === "not_found")) throw error
}Last updated