code: public ScanStatus resubmitWorkflowTasks(String scanId) {
          ScanStatus status = _scanStatusDAO.getScanStatus(scanId);
          if (status == null) {
              return null;
          }
  
          if (status.getCompleteTime() == null) {
              // Resubmit any active tasks
              for (ScanRangeStatus active : status.getActiveScanRanges()) {
                  _scanWorkflow.addScanRangeTask(scanId, active.getTaskId(), active.getPlacement(), active.getScanRange());
              }
  
              // Send notification to evaluate whether any new range tasks can be started
              _scanWorkflow.scanStatusUpdated(scanId);
          }
  
          return status;
      }
docs: Sometimes due to unexpected errors while submitting scan ranges to the underlying queues a scan can get stuck.
  This method takes all available tasks for a scan and resubmits them.  This method is safe because
  the underlying system is resilient to task resubmissions and concurrent work on the same task.