Start worker threads after second instance check

This commit is contained in:
Fedor Indutny 2022-01-14 08:23:46 -08:00 committed by GitHub
parent 7a2cd61955
commit 7486312e4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 33 deletions

View File

@ -119,29 +119,15 @@ const development =
const enableCI = config.get<boolean>('enableCI');
const sql = new MainSQL();
const heicConverter = getHeicConverter();
const preventDisplaySleepService = new PreventDisplaySleepService(
powerSaveBlocker
);
let systemTrayService: SystemTrayService | undefined;
const systemTraySettingCache = new SystemTraySettingCache(
sql,
ephemeralConfig,
process.argv,
app.getVersion()
);
const challengeHandler = new ChallengeMainHandler();
const nativeThemeNotifier = new NativeThemeNotifier();
nativeThemeNotifier.initialize();
let sqlInitTimeStart = 0;
let sqlInitTimeEnd = 0;
let appStartInitialSpellcheckSetting = true;
const defaultWebPrefs = {
@ -151,25 +137,6 @@ const defaultWebPrefs = {
!isProduction(app.getVersion()),
};
async function getSpellCheckSetting() {
const fastValue = ephemeralConfig.get('spell-check');
if (fastValue !== undefined) {
getLogger().info('got fast spellcheck setting', fastValue);
return fastValue;
}
const json = await sql.sqlCall('getItemById', ['spell-check']);
// Default to `true` if setting doesn't exist yet
const slowValue = json ? json.value : true;
ephemeralConfig.set('spell-check', slowValue);
getLogger().info('got slow spellcheck setting', slowValue);
return slowValue;
}
function showWindow() {
if (!mainWindow) {
return;
@ -231,6 +198,39 @@ if (!process.mas) {
}
/* eslint-enable no-console */
let sqlInitTimeStart = 0;
let sqlInitTimeEnd = 0;
const sql = new MainSQL();
const heicConverter = getHeicConverter();
async function getSpellCheckSetting() {
const fastValue = ephemeralConfig.get('spell-check');
if (fastValue !== undefined) {
getLogger().info('got fast spellcheck setting', fastValue);
return fastValue;
}
const json = await sql.sqlCall('getItemById', ['spell-check']);
// Default to `true` if setting doesn't exist yet
const slowValue = json ? json.value : true;
ephemeralConfig.set('spell-check', slowValue);
getLogger().info('got slow spellcheck setting', slowValue);
return slowValue;
}
let systemTrayService: SystemTrayService | undefined;
const systemTraySettingCache = new SystemTraySettingCache(
sql,
ephemeralConfig,
process.argv,
app.getVersion()
);
const windowFromUserConfig = userConfig.get('window');
const windowFromEphemeral = ephemeralConfig.get('window');
export const windowConfigSchema = z.object({