mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode a4177f50c475fc0fa278a78235e3bee9ffdec781 (#8649)
* Merge from vscode a4177f50c475fc0fa278a78235e3bee9ffdec781 * distro * fix tests
This commit is contained in:
@@ -11,16 +11,16 @@ import { isUndefined, isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { IStateService } from 'vs/platform/state/node/state';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
type StorageDatebase = { [key: string]: any; };
|
||||
type StorageDatabase = { [key: string]: any; };
|
||||
|
||||
export class FileStorage {
|
||||
|
||||
private _database: StorageDatebase | null = null;
|
||||
private _database: StorageDatabase | null = null;
|
||||
private lastFlushedSerializedDatabase: string | null = null;
|
||||
|
||||
constructor(private dbPath: string, private onError: (error: Error) => void) { }
|
||||
|
||||
private get database(): StorageDatebase {
|
||||
private get database(): StorageDatabase {
|
||||
if (!this._database) {
|
||||
this._database = this.loadSync();
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export class FileStorage {
|
||||
this._database = database;
|
||||
}
|
||||
|
||||
private loadSync(): StorageDatebase {
|
||||
private loadSync(): StorageDatabase {
|
||||
try {
|
||||
this.lastFlushedSerializedDatabase = fs.readFileSync(this.dbPath).toString();
|
||||
|
||||
@@ -56,7 +56,7 @@ export class FileStorage {
|
||||
}
|
||||
}
|
||||
|
||||
private async loadAsync(): Promise<StorageDatebase> {
|
||||
private async loadAsync(): Promise<StorageDatabase> {
|
||||
try {
|
||||
this.lastFlushedSerializedDatabase = (await readFile(this.dbPath)).toString();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user