next-issue 6.6.46 → 6.6.47

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/README.md CHANGED
@@ -619,7 +619,8 @@ affect another. The worker:
619
619
  lock is stale, and is taken over, when no process has that id or the process
620
620
  with that id started at another time, for example because the system gave
621
621
  the id of a worker that was killed or lost in a reboot to another process.
622
- A lock without a start time, from an older version, is stale too. A worker
622
+ A lock without a start time, from an older version, is held while a process
623
+ with that id is alive, and stale otherwise. A worker
623
624
  that cannot read its own start time exits with an error and takes no lock.
624
625
  When several workers start at once, one takes the lock and the others exit
625
626
  with `another worker is running`. A worker that stops removes the lock file
package/dist/lock.mjs CHANGED
@@ -34,9 +34,12 @@ async function holderOf(text) {
34
34
  const [first = '', ...rest] = text.trim().split(' ');
35
35
  const pid = Number(first);
36
36
  const started = rest.join(' ');
37
- if (!(pid > 0) || started === '') {
37
+ if (!(pid > 0)) {
38
38
  return undefined;
39
39
  }
40
+ if (started === '') {
41
+ return isAlive(pid) ? pid : undefined;
42
+ }
40
43
  return (await processStart(pid)) === started ? pid : undefined;
41
44
  }
42
45
  export async function lockHolder(lockPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.46",
3
+ "version": "6.6.47",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",