File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,15 @@ export class CopilotPRWatcher extends Disposable {
116116 this . _pollForChanges ( ) ;
117117 }
118118 } ) ) ;
119+ this . _register ( { dispose : ( ) => this . _timeout && clearTimeout ( this . _timeout ) } ) ;
119120 }
120121
121122 private _queriesIncludeCopilot ( ) : string | undefined {
122123 const queries = vscode . workspace . getConfiguration ( PR_SETTINGS_NAMESPACE ) . get < { label : string ; query : string } [ ] > ( QUERIES , [ ] ) ;
123124 return queries . find ( query => isCopilotQuery ( query . query ) ) ?. query ;
124125 }
125126
127+ private _timeout : NodeJS . Timeout | undefined ;
126128 private async _pollForChanges ( ) : Promise < void > {
127129 const query = this . _queriesIncludeCopilot ( ) ;
128130 if ( ! query ) {
@@ -131,7 +133,7 @@ export class CopilotPRWatcher extends Disposable {
131133
132134 await this . _getStateChanges ( query ) ;
133135
134- setTimeout ( ( ) => {
136+ this . _timeout = setTimeout ( ( ) => {
135137 this . _pollForChanges ( ) ;
136138 } , 60 * 1000 ) ; // Poll every minute
137139 }
You can’t perform that action at this time.
0 commit comments