File tree Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Original file line number Diff line number Diff line change @@ -415,34 +415,6 @@ export class PageContext {
415415 return writeDeclaration ( this , this . options . dts )
416416 }
417417
418- private async writePagesJSONFile ( pagesJson : string , retry = 3 ) : Promise < void > {
419- if ( retry <= 0 ) {
420- debug . error ( `${ this . resolvedPagesJSONPath } 获取文件锁失败,写入失败` )
421- return
422- }
423-
424- let relase : ( ) => Promise < void > | undefined
425-
426- try {
427- try {
428- // 获取文件锁
429- relase = await lockfile . lock ( this . resolvedPagesJSONPath , { realpath : false } )
430- }
431- catch {
432- // 获取文件锁失败
433- return this . writePagesJSONFile ( pagesJson , retry - 1 )
434- }
435- await fs . promises . writeFile ( this . resolvedPagesJSONPath , pagesJson , { encoding : 'utf-8' } ) // 执行写入操作
436- }
437- finally {
438- // eslint-disable-next-line ts/ban-ts-comment
439- // @ts -expect-error'
440- if ( relase ) {
441- await relase ( ) // 释放文件锁
442- }
443- }
444- }
445-
446418 private async genratePagesJSON ( ) {
447419 const content = await fs . promises . readFile ( this . resolvedPagesJSONPath , { encoding : 'utf-8' } ) . catch ( ( ) => '' )
448420
You can’t perform that action at this time.
0 commit comments