[Change] ImageCacheHandler 将缓存键名从downloadLink更改为fileName;

[Change] PixivUgoiraBuilderTest 暂时设置单元测试忽略以关闭耗时的测试, 加快构建速度;
This commit is contained in:
2020-04-16 17:12:24 +08:00
parent 4304cfcef2
commit 006352679a
2 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package net.lamgc.cgj.bot.cache;
import net.lamgc.cgj.Main;
import net.lamgc.cgj.pixiv.PixivURL;
import net.lamgc.cgj.util.URLs;
import net.lamgc.utils.event.EventHandler;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
@ -69,7 +70,7 @@ public class ImageCacheHandler implements EventHandler {
log.error("下载图片时发生异常", e);
return;
}
event.getImageCache().put(event.getDownloadLink(), storeFile);
event.getImageCache().put(URLs.getResourceName(event.getDownloadLink()), storeFile);
} finally {
log.info("图片 {} Event结束({})", event.getStoreFile().getName(), Integer.toHexString(event.hashCode()));
cacheQueue.remove(event);

View File

@ -4,6 +4,7 @@ import org.apache.http.HttpHost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.bouncycastle.util.io.Streams;
import org.junit.Ignore;
import org.junit.Test;
import java.io.File;
@ -11,6 +12,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
@Ignore
public class PixivUgoiraBuilderTest {
@Test