Enable background throttling for alpha users

This commit is contained in:
Fedor Indutny 2022-01-26 12:17:46 -08:00 committed by GitHub
parent 28940d1a34
commit 0cf28344a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,7 +73,7 @@ import { createTemplate } from './menu';
import { installFileHandler, installWebHandler } from './protocol_filter'; import { installFileHandler, installWebHandler } from './protocol_filter';
import * as OS from '../ts/OS'; import * as OS from '../ts/OS';
import { createBrowserWindow } from '../ts/util/createBrowserWindow'; import { createBrowserWindow } from '../ts/util/createBrowserWindow';
import { isProduction } from '../ts/util/version'; import { isProduction, isAlpha } from '../ts/util/version';
import { import {
isSgnlHref, isSgnlHref,
isCaptchaHref, isCaptchaHref,
@ -117,6 +117,8 @@ const development =
getEnvironment() === Environment.Development || getEnvironment() === Environment.Development ||
getEnvironment() === Environment.Staging; getEnvironment() === Environment.Staging;
const isThrottlingEnabled = development || isAlpha(app.getVersion());
const enableCI = config.get<boolean>('enableCI'); const enableCI = config.get<boolean>('enableCI');
const preventDisplaySleepService = new PreventDisplaySleepService( const preventDisplaySleepService = new PreventDisplaySleepService(
@ -479,10 +481,7 @@ async function createWindow() {
), ),
nativeWindowOpen: true, nativeWindowOpen: true,
spellcheck: await getSpellCheckSetting(), spellcheck: await getSpellCheckSetting(),
// We are evaluating background throttling in development. If we decide to backgroundThrottling: isThrottlingEnabled,
// move forward, we can remove this line (as `backgroundThrottling` is true by
// default).
backgroundThrottling: development,
enablePreferredSizeMode: true, enablePreferredSizeMode: true,
}, },
icon: windowIcon, icon: windowIcon,
@ -774,9 +773,7 @@ ipc.on('set-is-call-active', (_event, isCallActive) => {
return; return;
} }
// We are evaluating background throttling in development. If we decide to move if (!isThrottlingEnabled) {
// forward, we can remove this check.
if (!development) {
return; return;
} }