This repository was archived by the owner on Oct 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export default class extends Command {
1111 DurationFlag
1212 ]
1313
14- async wait ( ms : number ) { return new Promise ( resolve => setTimeout ( resolve , ms ) ) }
14+ async sleep ( ms : number ) { return new Promise ( resolve => setTimeout ( resolve , ms ) ) }
1515
1616 duration = new Duration ( this )
1717
@@ -21,7 +21,7 @@ export default class extends Command {
2121 }
2222
2323 async main ( ) {
24- await this . wait ( 5000 )
24+ await this . sleep ( 5000 )
2525 console . log ( 'Done restarting dynos' )
2626 }
2727}
Original file line number Diff line number Diff line change @@ -43,12 +43,13 @@ export default class Duration {
4343 return magnitude * multiplier
4444 }
4545 }
46+ async sleep ( ms : number ) { return new Promise ( resolve => setTimeout ( resolve , ms ) ) }
4647
4748 async wait ( ) {
48- return new Promise ( resolve => setTimeout ( resolve , this . parse ( this . cmd . flags . duration ) ) )
49- . then ( ( ) => {
50- console . log ( 'operation did not complete in provided duration' )
51- } )
49+
50+ let resolved = await this . sleep ( this . parse ( this . cmd . flags . duration ) )
51+ console . log ( 'operation did not complete in provided duration' )
52+ return resolved
5253 }
5354
5455 get duration ( ) : number {
You can’t perform that action at this time.
0 commit comments