@@ -479,17 +479,6 @@ class RustLanguageClient extends AutoLanguageClient {
479
479
( ) => this . _restartLanguageServers ( ) . catch ( logErr )
480
480
) )
481
481
482
- // check for updates (if enabled) every so often
483
- let periodicUpdateTimeoutId
484
- const periodicUpdate = async ( ) => {
485
- await this . _promptToUpdateToolchain ( ) . catch ( logErr )
486
- periodicUpdateTimeoutId = setTimeout ( periodicUpdate , PERIODIC_UPDATE_CHECK_MILLIS )
487
- }
488
- this . disposables . add ( new Disposable ( ( ) => {
489
- clearTimeout ( periodicUpdateTimeoutId )
490
- } ) )
491
- this . _periodicUpdate = periodicUpdate
492
-
493
482
this . disposables . add ( atom . commands . add (
494
483
'atom-workspace' ,
495
484
'ide-rust:restart-all-language-servers' ,
@@ -544,10 +533,19 @@ class RustLanguageClient extends AutoLanguageClient {
544
533
}
545
534
546
535
async startServerProcess ( projectPath ) {
547
- if ( this . _periodicUpdate ) {
548
- // if haven't started checking for updates yet start now
549
- this . _periodicUpdate ( )
550
- delete this . _periodicUpdate
536
+ if ( ! this . _periodicUpdateChecking ) {
537
+ // if haven't started periodic checks for updates yet start now
538
+ let periodicUpdateTimeoutId
539
+ const periodicUpdate = async ( ) => {
540
+ await this . _promptToUpdateToolchain ( ) . catch ( logErr )
541
+ periodicUpdateTimeoutId = setTimeout ( periodicUpdate , PERIODIC_UPDATE_CHECK_MILLIS )
542
+ }
543
+ this . disposables . add ( new Disposable ( ( ) => {
544
+ clearTimeout ( periodicUpdateTimeoutId )
545
+ delete this . _periodicUpdateChecking
546
+ } ) )
547
+ this . _periodicUpdateChecking = true
548
+ periodicUpdate ( ) . catch ( logErr )
551
549
}
552
550
553
551
let cmdOverride = rlsCommandOverride ( )
0 commit comments