mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-04 17:56:53 +00:00
feat(nodejs): pause and resume jobs from the TypeScript SDK (#4113)
Companion to #4112: `pauseJob` and `resumeJob` on `Connection`, posting to the server's `/v1/jobs/pause` and `/v1/jobs/resume` endpoints. A pause parks the job until it is resumed: its workers drain and stop, and a resume re-queues it to pick work back up from checkpoints. The outcome strings mirror the server's answers — `"pausing"`, `"already_paused"`, or `"committing"` (a job finalizing its results cannot be parked; retry shortly), and `"resumed"`, `"still_pausing"`, or `"not_paused"` — so a caller can retry the transient refusals rather than treat them as failures. Stacked on #4112 (shares the Rust core change); draft until the server-side endpoints reach production.
This commit is contained in:
@@ -798,6 +798,28 @@ abstract openTable(
|
||||
|
||||
***
|
||||
|
||||
### pauseJob()
|
||||
|
||||
```ts
|
||||
abstract pauseJob(jobId): Promise<string>
|
||||
```
|
||||
|
||||
Pause a server-side job by id.
|
||||
|
||||
The job's workers drain and it stays parked until resumed. Resolves to
|
||||
"pausing", "already_paused", or "committing" -- a job finalizing its
|
||||
results cannot be parked; retry shortly.
|
||||
|
||||
#### Parameters
|
||||
|
||||
* **jobId**: `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`>
|
||||
|
||||
***
|
||||
|
||||
### renameTable()
|
||||
|
||||
```ts
|
||||
@@ -831,6 +853,28 @@ a "not supported" error.
|
||||
|
||||
***
|
||||
|
||||
### resumeJob()
|
||||
|
||||
```ts
|
||||
abstract resumeJob(jobId): Promise<string>
|
||||
```
|
||||
|
||||
Resume a paused server-side job by id.
|
||||
|
||||
Its workers pick their work back up from checkpoints. Resolves to
|
||||
"resumed", "still_pausing" -- the pause's worker drain is not confirmed
|
||||
yet; retry shortly -- or "not_paused".
|
||||
|
||||
#### Parameters
|
||||
|
||||
* **jobId**: `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`>
|
||||
|
||||
***
|
||||
|
||||
### ~~tableNames()~~
|
||||
|
||||
#### tableNames(options)
|
||||
|
||||
Reference in New Issue
Block a user