diff --git a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/RedirectManager.java b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/RedirectManager.java index 7fe75c151..32d1102fd 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/RedirectManager.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/RedirectManager.java @@ -277,9 +277,7 @@ public boolean addRedirect(VirtualProc proc, GroupInterface group, boolean kill, * @return */ public boolean redirect(VirtualProc proc) { - try { - Redirect r = redirectService.remove(proc.getProcId()); if (r == null) { logger.info("Failed to find redirect for proc " + proc); @@ -307,36 +305,22 @@ public boolean redirect(VirtualProc proc) { DispatchHost host = hostManager.getDispatchHost(proc.getHostId()); switch (r.getType()) { - case JOB_REDIRECT: - logger.info("attempting a job redirect to " + r.getDestinationId()); JobInterface job = jobDao.getJob(r.getDestinationId()); logger.info("redirecting proc " + proc + " to job " + job.getName()); - - if (dispatcher.isTestMode()) { - dispatcher.dispatchHost(host, job); - } else { - bookingQueue.execute(new DispatchBookHost(host, job, dispatcher, env)); - } + dispatcher.dispatchHost(host, job); return true; case GROUP_REDIRECT: - logger.info("attempting a group redirect to " + r.getDestinationId()); GroupInterface group = groupDao.getGroup(r.getDestinationId()); logger.info("redirecting group " + proc + " to job " + group.getName()); - - if (dispatcher.isTestMode()) { - dispatcher.dispatchHost(host, group); - } else { - bookingQueue.execute(new DispatchBookHost(host, group, dispatcher, env)); - } + dispatcher.dispatchHost(host, group); return true; default: logger.info("redirect failed, invalid redirect type: " + r.getType()); return false; } - } catch (Exception e) { /* * If anything fails the redirect fails, so just return false after logging.