sleep a bit to give event chance to propagate
This commit is contained in:
@@ -48,6 +48,9 @@ public class DownloadServlet extends HttpServlet {
|
|||||||
event.setSources(searchManager.getResults().get(uuid).getPossibleSources(infoHash));
|
event.setSources(searchManager.getResults().get(uuid).getPossibleSources(infoHash));
|
||||||
event.setTarget(new File(core.getMuOptions().getDownloadLocation(), resultsArray[0].getName()));
|
event.setTarget(new File(core.getMuOptions().getDownloadLocation(), resultsArray[0].getName()));
|
||||||
core.getEventBus().publish(event);
|
core.getEventBus().publish(event);
|
||||||
|
try {
|
||||||
|
Thread.sleep(100);
|
||||||
|
} catch (InterruptedException e) {}
|
||||||
} else if (action.equals("cancel")) {
|
} else if (action.equals("cancel")) {
|
||||||
downloadManager.getDownloaders().stream().filter(d -> d.getInfoHash().equals(infoHash)).findAny().
|
downloadManager.getDownloaders().stream().filter(d -> d.getInfoHash().equals(infoHash)).findAny().
|
||||||
ifPresent(d -> {
|
ifPresent(d -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user