Uploaded image for project: 'NetarchiveSuite'
  1. NetarchiveSuite
  2. NAS-2675

dk.netarkivet.harvester.webinterface.HarvestStatusQuery(Long harvestId, Long harvestRunNumber) doesn't work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 5.5
    • 5.2.2
    • None
    • None

    Description

      I used this code in the harvesting workflow in the webdanica workflow, and it worked in NetarchiveSuite 5.1. But after upgrading to 5.2.2, it never returns any valid results, even after
      the netarchivesuite has completed the harvest.

      public static JobStatusInfo getHarvestStatus(Long hid) {
              if (hid == null) {
                  logger.warning("Null harvestdefinition is not valid");
                  return null;
              }
              HarvestDefinitionDAO hdao = HarvestDefinitionDAO.getInstance();
              if (hdao.exists(hid)) {
                  HarvestStatusQuery hsq = new HarvestStatusQuery(hid, 0); 
                  HarvestStatus hs = JobDAO.getInstance().getStatusInfo(hsq);
                  List<JobStatusInfo> jobs = hs.getJobStatusInfo();
                  if (jobs.size() == 0) { // No jobs yet created (What can go wrong here??)
                      return null;
                  } else if (jobs.size() == 1) {
                      return jobs.get(0);
                  } else {
                      throw new WebdanicaException("Should be either 0 or 1 jobs generated, but there are  " + jobs.size() + " jobs for harvestId " + hid + " and harvestRun 0");   
                  }
              } else {
                  logger.warning("No harvestdefinition w/id=" + hid + " exists!");
                  return null;
              }
          } 
      

      Attachments

        Activity

          People

            svc Søren Vejrup Carlsen (Inactive)
            svc Søren Vejrup Carlsen (Inactive)
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: