Skip to content

Commit

Permalink
style: Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Oct 22, 2023
1 parent 380754f commit bec8e33
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/task/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { setTimeout } from 'timers/promises'

/**
* @module @xmcl/task
*/
Expand Down Expand Up @@ -149,7 +147,7 @@ export abstract class BaseTask<T> implements Task<T> {
this.reject(new CancelledError())
try {
if (timeout) {
await Promise.race([this.cancelTask(), setTimeout(timeout)])
await Promise.race([this.cancelTask(), new Promise((resolve) => setTimeout(resolve, timeout))])
} else {
await this.cancelTask()
}
Expand Down

0 comments on commit bec8e33

Please sign in to comment.