@brainervirus/workit-core 8.15.0 → 8.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/workers.ts +9 -0
package/package.json
CHANGED
package/src/core/workers.ts
CHANGED
|
@@ -51,3 +51,12 @@ export const workerBlocksTransition = (
|
|
|
51
51
|
transition: "pause" | "resume" | "revise" | "close",
|
|
52
52
|
state: WorkerState,
|
|
53
53
|
): boolean => (transition === "pause" ? false : isUncertainWorker(state));
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A worker may be continued in its own session only while it holds live
|
|
57
|
+
* state: a running process, or uncommitted changes in its worktree. A worker
|
|
58
|
+
* that reported and is clean is continued by a fresh worker on the same
|
|
59
|
+
* slice. An unreadable worktree counts as no live state.
|
|
60
|
+
*/
|
|
61
|
+
export const holdsLiveState = (state: WorkerState, dirty: boolean | null): boolean =>
|
|
62
|
+
state === "running" || dirty === true;
|