Prefer CDNs when subscribing to a new list

Also, purging the cache of a list should not remove the
compiled version of that list so that it keep being seen
as cached, but obsolete.
This commit is contained in:
Raymond Hill 2023-11-07 08:21:22 -05:00
parent ae24032607
commit 3ff456a63d
No known key found for this signature in database
GPG key ID: 25E1490B761470C2
3 changed files with 2 additions and 4 deletions

View file

@ -292,7 +292,7 @@ const renderWidgets = ( ) => {
dom.cl.toggle('#buttonUpdate', 'active', updating);
dom.cl.toggle('#buttonUpdate', 'disabled',
updating === false &&
qs$('#lists .listEntry.checked.obsolete:not(.toRemove)') === null
qs$('#lists .listEntry.checked.obsolete.cached:not(.toRemove)') === null
);
dom.cl.toggle('#buttonPurgeAll', 'disabled',
updating || qs$('#lists .listEntry.cached:not(.obsolete)') === null
@ -519,7 +519,6 @@ const onPurgeClicked = ev => {
// An external filter list must not be marked as obsolete, they will
// always be fetched anyways if there is no cached copy.
dom.cl.add(liEntry, 'obsolete');
dom.cl.remove(liEntry, 'cached');
if ( qs$(liEntry, 'input[type="checkbox"]').checked ) {
renderWidgets();

View file

@ -1262,7 +1262,7 @@ async function diffUpdater() {
} else if ( data.error ) {
ubolog(`Diff updater: failed to update ${data.name} using ${data.patchPath}, reason: ${data.error}`);
} else if ( data.status === 'nopatch-yet' || data.status === 'nodiff' ) {
ubolog(`Diff updater: Skip update of ${data.name} using ${data.patchPath}, reason: ${data.status}`);
ubolog(`Diff updater: skip update of ${data.name} using ${data.patchPath}, reason: ${data.status}`);
assetCacheSetDetails(data.name, {
writeTime: data.lastModified || 0
});

View file

@ -1633,7 +1633,6 @@ const onMessage = function(request, sender, callback) {
case 'purgeCaches':
for ( const assetKey of request.assetKeys ) {
io.purge(assetKey);
io.remove(`compiled/${assetKey}`);
}
break;