sleep a bit to give event chance to propagate

pull/34/head
Zlatin Balevsky 2019-12-03 06:04:14 +00:00
parent d0318e3e83
commit a5eccbdc2b
1 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,9 @@ public class DownloadServlet extends HttpServlet {
event.setSources(searchManager.getResults().get(uuid).getPossibleSources(infoHash));
event.setTarget(new File(core.getMuOptions().getDownloadLocation(), resultsArray[0].getName()));
core.getEventBus().publish(event);
try {
Thread.sleep(100);
} catch (InterruptedException e) {}
} else if (action.equals("cancel")) {
downloadManager.getDownloaders().stream().filter(d -> d.getInfoHash().equals(infoHash)).findAny().
ifPresent(d -> {