Skip to content

Commit

Permalink
Update src/index.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Shigma <[email protected]>
  • Loading branch information
MaikoTan and shigma authored Aug 15, 2024
1 parent a6bd059 commit 7b2aa62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,11 @@ export function apply(ctx: Context, config: Config) {
if (globalTasks.size >= config.globalConcurrency) {
const pendingId = container.pop()
globalPending.add(pendingId)
await new Promise<void>((resolve) => ctx.once('novelai/finish', (id) => {
if (id === pendingId) {
await new Promise<void>((resolve) => {
const dispose = ctx.on('novelai/finish', (id) => {
if (id !== pendingId) return
resolve()
dispose()
}
}))

Check failure on line 318 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

',' expected.

Check failure on line 318 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

';' expected.
}

Check failure on line 319 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

',' expected.

Check failure on line 319 in src/index.ts

View workflow job for this annotation

GitHub Actions / build

';' expected.
Expand Down

0 comments on commit 7b2aa62

Please sign in to comment.