Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit 8f2359a

Browse files
committed
add { signal} to updateAllSourceFiles()
1 parent 3dd6be0 commit 8f2359a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/zinnia.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ const capitalize = str => `${str.charAt(0).toUpperCase()}${str.slice(1)}`
7676

7777
const updateAllSourceFiles = async ({
7878
moduleVersionsDir,
79-
moduleSourcesDir
79+
moduleSourcesDir,
80+
signal
8081
}) => {
8182
const modules = await Promise.all(
8283
Object
@@ -91,6 +92,7 @@ const updateAllSourceFiles = async ({
9192
moduleSourcesDir
9293
}),
9394
{
95+
signal,
9496
retries: 10,
9597
onFailedAttempt: err => {
9698
console.error(err)
@@ -160,7 +162,8 @@ const runUpdateSourceFilesLoop = async ({
160162
try {
161163
const shouldRestart = await updateAllSourceFiles({
162164
moduleVersionsDir,
163-
moduleSourcesDir
165+
moduleSourcesDir,
166+
signal
164167
})
165168
if (shouldRestart) {
166169
onActivity({
@@ -282,7 +285,11 @@ export async function run ({
282285
type: 'info',
283286
message: 'Updating source code for Zinnia modules...'
284287
})
285-
await updateAllSourceFiles({ moduleVersionsDir, moduleSourcesDir })
288+
await updateAllSourceFiles({
289+
moduleVersionsDir,
290+
moduleSourcesDir,
291+
signal: null
292+
})
286293
onActivity({
287294
type: 'info',
288295
message: 'Zinnia module source code up to date'

0 commit comments

Comments
 (0)