Commit c04e1df
fix: register worker task name at startup to prevent spurious early exit (#165)
The watchWorkerInstancesLoop captures `me` with task=undefined at startup
because the initial getWorkerInstance() call has no task parameter. Any other
process that also calls getWorkerInstance() without a task (e.g. updateGithubActionTask
scheduler running at the same time) matches the task===undefined condition and
incorrectly evicts the main bot process.
Fix: call getWorkerInstance("ComfyPR Bot Running") before Promise.all so that
me.task is already set when watchWorkerInstancesLoop starts. Only a competing
instance with the same task name can now trigger an exit.
Co-authored-by: snomiao <snomiao@gmail.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 3101578 commit c04e1df
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
| |||
0 commit comments