mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
refactoring
This commit is contained in:
parent
4aa0eedead
commit
f5efdb21fd
|
@ -172,10 +172,6 @@ public final class Cache {
|
|||
* @param url the url of the resource
|
||||
* @return true if the content of the url is in the cache, false otherwise
|
||||
*/
|
||||
public static boolean has(final DigestURI url) {
|
||||
return has(url.hash());
|
||||
}
|
||||
|
||||
public static boolean has(final byte[] urlhash) {
|
||||
boolean headerExists;
|
||||
boolean fileExists;
|
||||
|
@ -254,12 +250,12 @@ public final class Cache {
|
|||
* @param url
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void delete(final DigestURI url) throws IOException {
|
||||
public static void delete(final byte[] hash) throws IOException {
|
||||
if (responseHeaderDB instanceof MapHeap) {
|
||||
((MapHeap) responseHeaderDB).delete(url.hash());
|
||||
((MapHeap) responseHeaderDB).delete(hash);
|
||||
} else {
|
||||
responseHeaderDB.remove(url.hash());
|
||||
responseHeaderDB.remove(hash);
|
||||
}
|
||||
fileDB.delete(url.hash());
|
||||
fileDB.delete(hash);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -502,7 +502,7 @@ public final class HTTPDProxyHandler {
|
|||
final byte[] b = Cache.getContent(url.hash());
|
||||
if (b != null) sizeBeforeDelete = b.length;
|
||||
}
|
||||
Cache.delete(url);
|
||||
Cache.delete(url.hash());
|
||||
conProp.put(HeaderFramework.CONNECTION_PROP_PROXY_RESPOND_CODE, "TCP_REFRESH_MISS");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user