@RequestMapping(value="all_podcasts",method=RequestMethod.GET) public String updateAllPodcasts(ModelMap model){
  LOG.debug("------ received request to update all podcasts -----");
  Integer numberOfWorkerThreads=Integer.valueOf(configBean.get("NO_WORKER_THREADS_FOR_UPDATE_ALL_PODCASTS"));
  if (numberOfWorkerThreads == null) {
    numberOfWorkerThreads=DEFAULT_NO_WORKER_THREADS_FOR_UPDATE_ALL_PODCASTS;
  }
  Integer totalNumberOfPodcasts=readService.getNumberOfPodcasts();
  Integer mod=totalNumberOfPodcasts % numberOfWorkerThreads;
  Integer chunkSize=totalNumberOfPodcasts / numberOfWorkerThreads;
  for (int i=0; i < numberOfWorkerThreads; i++) {
    int startRow=i * chunkSize;
    if (i == numberOfWorkerThreads - 1) {
      chunkSize=chunkSize + mod;
      LOG.debug("Thread[" + i + "] - ["+ startRow+ ","+ chunkSize+ "]");
      Future<String> future=batchUpdateService.updatePodcastsFromRange(startRow,chunkSize);
    }
 else {
      LOG.debug("Thread[" + i + "] - ["+ startRow+ ","+ chunkSize+ "]");
      batchUpdateService.updatePodcastsFromRange(startRow,chunkSize);
    }
  }
  restClient.invokeRefreshAllCaches();
  return "redirect:/admin/update/batch";
}

@ RequestMapping ( value = "all_podcasts" , method = RequestMethod . GET ) public String updateAllPodcasts ( ModelMap model ) { LOG . debug ( "------ received request to update all podcasts -----" ) ; Integer numberOfWorkerThreads = Integer . valueOf ( configBean . get ( "NO_WORKER_THREADS_FOR_UPDATE_ALL_PODCASTS" ) ) ; if ( numberOfWorkerThreads == null ) { numberOfWorkerThreads = DEFAULT_NO_WORKER_THREADS_FOR_UPDATE_ALL_PODCASTS ; } Integer totalNumberOfPodcasts = readService . getNumberOfPodcasts ( ) ; Integer mod = totalNumberOfPodcasts % numberOfWorkerThreads ; Integer chunkSize = totalNumberOfPodcasts / numberOfWorkerThreads ; for ( int i = 0 ; i < numberOfWorkerThreads ; i ++ ) { int startRow = i * chunkSize ; if ( i == numberOfWorkerThreads - 1 ) { chunkSize = chunkSize + mod ; LOG . debug ( "Thread[" + i + "] - [" + startRow + "," + chunkSize + "]" ) ; Future < String > future = batchUpdateService . updatePodcastsFromRange ( startRow , chunkSize ) ; } else { LOG . debug ( "Thread[" + i + "] - [" + startRow + "," + chunkSize + "]" ) ; batchUpdateService . updatePodcastsFromRange ( startRow , chunkSize ) ; } } restClient . invokeRefreshAllCaches ( ) ; return "redirect:/admin/update/batch" ; }
update podcast by id or feed url
