(sync: Sync)
| 428 | } |
| 429 | |
| 430 | async function runPostPull(sync: Sync): Promise<PostPullOutcome> { |
| 431 | try { |
| 432 | const result = await sync.pull(); |
| 433 | return { |
| 434 | applied: result.applied, |
| 435 | skipped: result.skipped, |
| 436 | sync: { status: "complete", applied: result.applied, skipped: result.skipped }, |
| 437 | }; |
| 438 | } catch (error) { |
| 439 | try { |
| 440 | await sync.onPullPending?.(error); |
| 441 | } catch {} |
| 442 | return { |
| 443 | applied: 0, |
| 444 | skipped: [], |
| 445 | sync: { status: "pending", applied: 0, skipped: [], error: safeErrorMessage(error) }, |
| 446 | }; |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | async function drainToResult<E extends ExecEncoding>( |
| 451 | stream: ReadableStream<WorkspaceExecEvent<E>>, |
no test coverage detected