fix bug fix bug https://github.com/AriaLyy/Aria/issues/595
修复一个数据升级导致的taskType列不存在问题,https://github.com/AriaLyy/Aria/issues/586
This commit is contained in:
@@ -89,6 +89,9 @@ public final class HttpDGInfoTask implements IInfoTask {
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (!mPool.isShutdown()){
|
||||
mPool.shutdown();
|
||||
}
|
||||
} else {
|
||||
for (DTaskWrapper wrapper : wrapper.getSubTaskWrapper()) {
|
||||
cloneHeader(wrapper);
|
||||
|
||||
@@ -66,7 +66,7 @@ final class HttpDGLoader extends AbsGroupLoader {
|
||||
}
|
||||
|
||||
@Override public void onFail(AbsEntity entity, BaseException e, boolean needRetry) {
|
||||
getListener().onFail(needRetry, e);
|
||||
fail(e, needRetry);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.arialyy.aria.http.BaseHttpThreadTaskAdapter;
|
||||
import com.arialyy.aria.http.ConnectionHelp;
|
||||
import com.arialyy.aria.util.ALog;
|
||||
import com.arialyy.aria.util.BufferedRandomAccessFile;
|
||||
import com.arialyy.aria.util.FileUtil;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -112,7 +111,7 @@ final class HttpDThreadTaskAdapter extends BaseHttpThreadTaskAdapter {
|
||||
new BufferedRandomAccessFile(getThreadConfig().tempFile, "rwd",
|
||||
getTaskConfig().getBuffSize());
|
||||
//设置每条线程写入文件的位置
|
||||
if (getThreadRecord().startLocation > 0){
|
||||
if (getThreadRecord().startLocation > 0) {
|
||||
file.seek(getThreadRecord().startLocation);
|
||||
}
|
||||
readNormal(is, file);
|
||||
@@ -199,6 +198,7 @@ final class HttpDThreadTaskAdapter extends BaseHttpThreadTaskAdapter {
|
||||
fos = new FileOutputStream(getThreadConfig().tempFile, true);
|
||||
foc = fos.getChannel();
|
||||
fic = Channels.newChannel(is);
|
||||
|
||||
ByteBuffer bf = ByteBuffer.allocate(getTaskConfig().getBuffSize());
|
||||
//如果要通过 Future 的 cancel 方法取消正在运行的任务,那么该任务必定是可以 对线程中断做出响应 的任务。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user