Beispiel #1
0
  refresh: function() {
    var that = this;
    Job.findOne({
      id: that.job.id
    }, function(currentJob) {

      currentJob.syncTime();

      if (JobRefresher.needsUpdate(currentJob) && that.active) {
        setTimeout(function() {
          that.refresh();
        }, 5000);
      }
    }, function(response) {
      new ErrorPage(that.element, response);
    });

  },
Beispiel #2
0
  refresh: function() {
    var that = this;
    if (!JobRefresher.needsUpdate(that.job)) {
      return;
    }
    Job.findOne({
      id: that.job.id
    }, function(currentJob) {
      currentJob.syncTime();
      that.job.attr('state', currentJob.attr('state'));
      that.job.attr('startTime', currentJob.attr('startTime'));
      that.job.attr('endTime', currentJob.attr('endTime'));
      that.job.attr('setupStartTime', currentJob.attr('setupStartTime'));
      that.job.attr('setupEndTime', currentJob.attr('setupEndTime'));
      that.job.attr('steps', currentJob.attr('steps'));
      that.job.attr('positionInQueue', currentJob.attr('positionInQueue'));

      // needs refresh
      if (JobRefresher.needsUpdate(currentJob) && that.active) {
        setTimeout(function() {
          that.refresh();
        }, 5000);
      } else {
        // updates details (results, startTime, endTime, ...)
        JobDetails.findOne({
          id: that.job.id
        }, function(job) {

          if (that.active) {
            window.location.reload();
          }

        }, function(response) {
          new ErrorPage(that.element, response);

        });

      }

    });

  },