Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

pishguy
Copy link

@pishguy pishguy commented Nov 30, 2016

FIX BUG: get exception when task size is less than downloadPerTime

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) {
Copy link
Owner

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?

Copy link
Author

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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downloadTaskPerTime variable still final ?

Copy link
Author

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?

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants