mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-07-01 21:07:25 +00:00
[Change] ImageCacheHandler 将缓存键名从downloadLink更改为fileName;
[Change] PixivUgoiraBuilderTest 暂时设置单元测试忽略以关闭耗时的测试, 加快构建速度;
This commit is contained in:
@ -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);
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user