From d07e7b834831230b53860d0919a68edc2d36193d Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sat, 8 Jan 2022 21:36:43 +0100 Subject: build: Eslint fixes for multi-module project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kristóf Marussy --- .../services/impl/ConfigPersistenceServiceImpl.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'packages/main/src/services/impl/ConfigPersistenceServiceImpl.ts') diff --git a/packages/main/src/services/impl/ConfigPersistenceServiceImpl.ts b/packages/main/src/services/impl/ConfigPersistenceServiceImpl.ts index 2d19632..df8c807 100644 --- a/packages/main/src/services/impl/ConfigPersistenceServiceImpl.ts +++ b/packages/main/src/services/impl/ConfigPersistenceServiceImpl.ts @@ -19,18 +19,20 @@ */ import { watch } from 'fs'; import { readFile, stat, writeFile } from 'fs/promises'; -import JSON5 from 'json5'; -import { throttle } from 'lodash-es'; import { join } from 'path'; -import type { ConfigPersistenceService, ReadConfigResult } from '../ConfigPersistenceService.js'; -import type { ConfigSnapshotOut } from '../../stores/Config.js'; -import { Disposer } from '../../utils/disposer'; -import { getLogger } from '../../utils/logging'; +import JSON5 from 'json5'; +import throttle from 'lodash-es/throttle'; + +import type { ConfigSnapshotOut } from '../../stores/Config'; +import type Disposer from '../../utils/Disposer'; +import { getLogger } from '../../utils/log'; +import type ConfigPersistenceService from '../ConfigPersistenceService'; +import type { ReadConfigResult } from '../ConfigPersistenceService'; const log = getLogger('configPersistence'); -export class ConfigPersistenceServiceImpl implements ConfigPersistenceService { +export default class ConfigPersistenceServiceImpl implements ConfigPersistenceService { private readonly configFilePath: string; private writingConfig = false; @@ -103,7 +105,7 @@ export class ConfigPersistenceServiceImpl implements ConfigPersistenceService { 'whish is newer than last written', this.timeLastWritten, ); - return callback(); + await callback(); } }, throttleMs); @@ -115,7 +117,7 @@ export class ConfigPersistenceServiceImpl implements ConfigPersistenceService { if (eventType === 'change' && (filename === this.configFileName || filename === null)) { configChanged()?.catch((err) => { - console.log('Unhandled error while listening for config changes', err); + log.error('Unhandled error while listening for config changes', err); }); } }); -- cgit v1.2.3-54-g00ecf