File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,19 +60,19 @@ export default class LimiterFileSystem implements FileSystem {
6060 }
6161
6262 async open ( file : File ) : Promise < FileReader > {
63- const reader = await this . fs . open ( file ) ;
63+ const reader = await this . limiter . execute ( ( ) => this . fs . open ( file ) ) ;
6464 return {
6565 read : ( type ) => this . limiter . execute ( ( ) => reader . read ( type ) ) ,
6666 } ;
6767 }
6868
6969 async openDir ( path : string ) : Promise < FileSystem > {
70- const fs = await this . fs . openDir ( path ) ;
70+ const fs = await this . limiter . execute ( ( ) => this . fs . openDir ( path ) ) ;
7171 return new LimiterFileSystem ( fs , this . limiter ) ;
7272 }
7373
7474 async create ( path : string ) : Promise < FileWriter > {
75- const writer = await this . fs . create ( path ) ;
75+ const writer = await this . limiter . execute ( ( ) => this . fs . create ( path ) ) ;
7676 return {
7777 write : ( content ) => this . limiter . execute ( ( ) => writer . write ( content ) ) ,
7878 } ;
You can’t perform that action at this time.
0 commit comments