-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update QueueModerator.java #41
base: master
Are you sure you want to change the base?
Conversation
Get ```IndexOutOfBoundsException``` error
Add some code to help user to how can we use download multiple task
@@ -37,36 +37,43 @@ public QueueModerator(TasksDataSource tasksDataSource, ChunksDataSource chunksDa | |||
this.moderator = localModerator; | |||
this.moderator.setQueueObserver(this); | |||
this.listener = downloadManagerListener; | |||
this.downloadTaskPerTime = downloadPerTime; | |||
|
|||
if (tasks.size() < downloadPerTime) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe It's better to write something like this
this.downloadTaskPerTime = downloadPerTime;
if (tasks.size() < downloadPerTime) {
this.downloadTaskPerTime = tasks.size();
}
But why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes you have right, its better than my code
this.uncompletedTasks = tasks; | ||
|
||
downloaderList = | ||
new HashMap<Integer, Thread>(downloadTaskPerTime); | ||
downloaderList =new HashMap<>(downloadTaskPerTime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downloadTaskPerTime variable still final ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Alamusitl are you familiar with this library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not much
Add DeleteAllUncompletedsDownloads from database and files
add allUnCompleteds function
Fix latest commit for downloadTaskPerTime
FIX BUG: get exception when task size is less than downloadPerTime