mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 18:48:00 +00:00
Don't cache keytar until we know it works (#148567)
This commit is contained in:
parent
57dde38066
commit
708cb0c507
|
@ -101,7 +101,7 @@ export abstract class BaseCredentialsMainService extends Disposable implements I
|
|||
return;
|
||||
} catch (e) {
|
||||
error = e;
|
||||
this.logService.warn('Error attempting to set a password: ', e);
|
||||
this.logService.warn('Error attempting to set a password: ', e?.message ?? e);
|
||||
attempts++;
|
||||
await new Promise(resolve => setTimeout(resolve, 200));
|
||||
}
|
||||
|
|
|
@ -36,9 +36,10 @@ export class CredentialsNativeMainService extends BaseCredentialsMainService {
|
|||
return this._keytarCache;
|
||||
}
|
||||
|
||||
this._keytarCache = await import('keytar');
|
||||
const keytarCache = await import('keytar');
|
||||
// Try using keytar to see if it throws or not.
|
||||
await this._keytarCache.findCredentials('test-keytar-loads');
|
||||
await keytarCache.findCredentials('test-keytar-loads');
|
||||
this._keytarCache = keytarCache;
|
||||
return this._keytarCache;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue