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 37
37
"type" : " string" ,
38
38
"default" : " master" ,
39
39
"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."
40
45
}
41
46
}
42
47
},
Original file line number Diff line number Diff line change @@ -31,10 +31,21 @@ export class StatusBarManager {
31
31
}
32
32
33
33
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
+ }
36
46
}
37
- setTimeout ( ( ) => { this . refreshPullRequestStatus ( ) ; } , 5000 ) ;
47
+ setTimeout ( ( ) => { this . refreshPullRequestStatus ( ) ; } ,
48
+ vscode . workspace . getConfiguration ( 'github' ) . get < number > ( 'refreshPullRequestStatus' , 5 ) * 1000 ) ;
38
49
}
39
50
40
51
public async updatePullRequestStatus ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments