This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 3737 "type" : " string" ,
3838 "default" : " master" ,
3939 "description" : " The branch to create pull requests against."
40+ },
41+ "github.refreshPullRequestStatus" : {
42+ "type" : " number" ,
43+ "default" : 5 ,
44+ "description" : " Interval in seconds to refresh the current pull request status."
4045 }
4146 }
4247 },
Original file line number Diff line number Diff line change @@ -31,10 +31,21 @@ export class StatusBarManager {
3131 }
3232
3333 private async refreshPullRequestStatus ( ) : Promise < void > {
34- if ( this . githubManager . connected ) {
35- await this . updatePullRequestStatus ( ) ;
34+ try {
35+ if ( this . githubManager . connected ) {
36+ await this . updatePullRequestStatus ( ) ;
37+ }
38+ } catch ( e ) {
39+ if ( e instanceof GitHubError ) {
40+ console . log ( e ) ;
41+ this . channel . appendLine ( 'Failed to update pull request status:' ) ;
42+ this . channel . appendLine ( JSON . stringify ( e . response , undefined , ' ' ) ) ;
43+ } else {
44+ throw e ;
45+ }
3646 }
37- setTimeout ( ( ) => { this . refreshPullRequestStatus ( ) ; } , 5000 ) ;
47+ setTimeout ( ( ) => { this . refreshPullRequestStatus ( ) ; } ,
48+ vscode . workspace . getConfiguration ( 'github' ) . get < number > ( 'refreshPullRequestStatus' , 5 ) * 1000 ) ;
3849 }
3950
4051 public async updatePullRequestStatus ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments