#674 PurgeService: Always register if purging, reduce code duplication
- Rename autoPurging to isPurging: we should always register if a purge task is in progress (regardless if autopurge or not) and deny any new requests - Reduce the same logic being coded multiple times by calling through the methods - DataSource: remove purgeBanned in favor of purgeRecords, both do exactly the same thing
This commit is contained in:
@@ -143,14 +143,6 @@ public class CacheDataSource implements DataSource {
|
||||
return source.getRecordsToPurge(until);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void purgeRecords(Set<String> toPurge) {
|
||||
source.purgeRecords(toPurge);
|
||||
for (String name : toPurge) {
|
||||
cachedAuths.invalidate(name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAuth(String name) {
|
||||
name = name.toLowerCase();
|
||||
@@ -193,8 +185,8 @@ public class CacheDataSource implements DataSource {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void purgeBanned(final Set<String> banned) {
|
||||
source.purgeBanned(banned);
|
||||
public void purgeRecords(final Set<String> banned) {
|
||||
source.purgeRecords(banned);
|
||||
cachedAuths.invalidateAll(banned);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user