@@ -553,9 +553,15 @@ export class Wiki implements IWikiService {
553
553
// don't want it to throw here again, so no await here.
554
554
// eslint-disable-next-line @typescript-eslint/return-await
555
555
return this . workspaceViewService . restartWorkspaceViewService ( id ) ;
556
+ } else if ( ( error as Error ) . message . includes ( 'Did not receive an init message from worker after' ) ) {
557
+ // https://github.com/andywer/threads.js/issues/426
558
+ // wait some time and restart the wiki will solve this
559
+ logger . warn ( `Get startWiki() handle "${ ( error as Error ) ?. message } ", will try restart wiki.` ) ;
560
+ await this . restartWiki ( workspace ) ;
561
+ } else {
562
+ logger . warn ( 'Get startWiki() unexpected error, throw it' ) ;
563
+ throw error ;
556
564
}
557
- logger . warn ( 'Get startWiki() unexpected error, throw it' ) ;
558
- throw error ;
559
565
}
560
566
} else {
561
567
// if is private repo wiki
@@ -572,7 +578,7 @@ export class Wiki implements IWikiService {
572
578
}
573
579
574
580
public async restartWiki ( workspace : IWorkspace ) : Promise < void > {
575
- const { wikiFolderLocation, port, userName : workspaceUserName , isSubWiki, syncOnInterval } = workspace ;
581
+ const { wikiFolderLocation, port, userName : workspaceUserName , isSubWiki } = workspace ;
576
582
// use workspace specific userName first, and fall back to preferences' userName, pass empty editor username if undefined
577
583
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
578
584
const userName = ( workspaceUserName || ( await this . authService . get ( 'userName' ) ) ) ?? '' ;
0 commit comments