@armstrongnate/april 0.1.1 → 0.1.2
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/dist/processes.js +6 -1
- package/package.json +1 -1
package/dist/processes.js
CHANGED
|
@@ -43,6 +43,12 @@ function spawnForwarder(config, repoKey, url) {
|
|
|
43
43
|
function start() {
|
|
44
44
|
if (state.stopped)
|
|
45
45
|
return;
|
|
46
|
+
// Clear any hook left behind by a previous attempt. `gh webhook forward`
|
|
47
|
+
// can create the `cli` hook and then die before/while opening its receiving
|
|
48
|
+
// websocket (e.g. a transient relay 500), leaving an orphan that makes every
|
|
49
|
+
// restart fail with HTTP 422 "Hook already exists". Cleaning up before each
|
|
50
|
+
// (re)start guarantees a clean slate instead of a permanent restart loop.
|
|
51
|
+
cleanupStaleWebhooks(repoKey);
|
|
46
52
|
state.lastStartTime = Date.now();
|
|
47
53
|
log.info(`Starting webhook forwarder for ${repoKey}`);
|
|
48
54
|
const child = spawn("gh", [
|
|
@@ -93,7 +99,6 @@ export function startWebhookForwarders(config) {
|
|
|
93
99
|
const url = `http://localhost:${config.port}/webhook/github`;
|
|
94
100
|
for (const repo of config.repos) {
|
|
95
101
|
const repoKey = `${repo.owner}/${repo.name}`;
|
|
96
|
-
cleanupStaleWebhooks(repoKey);
|
|
97
102
|
const state = spawnForwarder(config, repoKey, url);
|
|
98
103
|
forwarders.push(state);
|
|
99
104
|
}
|
package/package.json
CHANGED