mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
Fix spurious update cycle attempts
Caused by the fact that external filter lists do not have an `off` property even when they are not enabled. Additionally, set the default update cycle check period to 2hr.
This commit is contained in:
parent
10f9559a52
commit
885b3ea6c0
@ -50,7 +50,7 @@ const hiddenSettingsDefault = {
|
||||
autoCommentFilterTemplate: '{{date}} {{origin}}',
|
||||
autoUpdateAssetFetchPeriod: 60,
|
||||
autoUpdateDelayAfterLaunch: 105,
|
||||
autoUpdatePeriod: 4,
|
||||
autoUpdatePeriod: 2,
|
||||
benchmarkDatasetURL: 'unset',
|
||||
blockingProfiles: '11111/#F00 11010/#C0F 11001/#00F 00001',
|
||||
cacheStorageAPI: 'unset',
|
||||
|
@ -1481,9 +1481,13 @@ self.addEventListener('hiddenSettingsChanged', ( ) => {
|
||||
const now = Date.now();
|
||||
|
||||
let needEmergencyUpdate = false;
|
||||
for ( const asset of Object.values(assetDict) ) {
|
||||
for ( const [ assetKey, asset ] of Object.entries(assetDict) ) {
|
||||
if ( asset.hasRemoteURL !== true ) { continue; }
|
||||
if ( asset.content === 'filters' && asset.off === true ) { continue; }
|
||||
if ( asset.content === 'filters' ) {
|
||||
if ( µb.selectedFilterLists.includes(assetKey) === false ) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ( asset.obsolete !== true ) { continue; }
|
||||
const lastUpdateInDays = (now - asset.writeTime) / 86400000;
|
||||
const daysSinceVeryObsolete = lastUpdateInDays - 2 * asset.updateAfter;
|
||||
@ -1602,7 +1606,9 @@ self.addEventListener('hiddenSettingsChanged', ( ) => {
|
||||
this.loadFilterLists();
|
||||
}
|
||||
if ( this.userSettings.autoUpdate ) {
|
||||
this.scheduleAssetUpdater(this.hiddenSettings.autoUpdatePeriod * 3600000 || 25200000);
|
||||
this.scheduleAssetUpdater(
|
||||
this.hiddenSettings.autoUpdatePeriod * 3600000 || 25200000
|
||||
);
|
||||
} else {
|
||||
this.scheduleAssetUpdater(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user