<commit_before>$(function() {

  // MyJobs
  // ------
  
  var timerId = 0;

  // update job table with current values
  var updateJobs = function() {
     $.getJSON(
      '/myjobs/update.json',
      {},
      function(json) {
        //var finished = true;
	var finished = false;
        $.each(json, function(index, job) {
            var status_class = ''
            if (job.status == 'ProcessSucceeded') {
              status_class = 'glyphicon glyphicon-ok-sign text-success';
            }
            else if (job.status == 'ProcessFailed') {
              status_class = 'glyphicon glyphicon-remove-sign text-danger';
            }
            else if (job.status == 'ProcessPaused') {
              status_class = 'glyphicon glyphicon-paused text-muted';
            }
            else if (job.status == 'ProcessStarted' || job.status == 'ProcessAccepted') {
              status_class = 'glyphicon glyphicon-cog text-muted';
              //finished = false;
            }
            else {
              status_class = 'glyphicon glyphicon-question-sign text-danger';
            }

            $("#status-"+job.identifier).attr('class', status_class);
            $("#status-"+job.identifier).attr('title', job.status);
            $("#duration-"+job.identifier).text(job.duration);
            $("#progress-"+job.identifier).attr('style', "width: "+job.progress+"%");
            $("#progress-"+job.identifier).text(job.progress + "%");
        });

        if (finished == true) {
          clearInterval(timerId);
        }
      }
    );
  };

  // refresh job list each 5 secs ...
  timerId = setInterval(function() {
    updateJobs();
  }, 5000); 

});<commit_msg>fixed job list refresh<commit_after>$(function() {

  // MyJobs
  // ------
  
  var timerId = 0;

  // update job table with current values
  var updateJobs = function() {
    $.getJSON(
      '/myjobs/update.json',
      {},
      function(json) {
        //var finished = true;
	var finished = false;
	var numRows = $("table tr").length - 1;
	if (numRows != json.length) {
	  location.reload();
	}
	else {
          $.each(json, function(index, job) {
            var status_class = ''
            if (job.status == 'ProcessSucceeded') {
              status_class = 'glyphicon glyphicon-ok-sign text-success';
            }
            else if (job.status == 'ProcessFailed') {
              status_class = 'glyphicon glyphicon-remove-sign text-danger';
            }
            else if (job.status == 'ProcessPaused') {
              status_class = 'glyphicon glyphicon-paused text-muted';
            }
            else if (job.status == 'ProcessStarted' || job.status == 'ProcessAccepted') {
              status_class = 'glyphicon glyphicon-cog text-muted';
              //finished = false;
            }
            else {
              status_class = 'glyphicon glyphicon-question-sign text-danger';
            }
	    
            $("#status-"+job.identifier).attr('class', status_class);
            $("#status-"+job.identifier).attr('title', job.status);
            $("#duration-"+job.identifier).text(job.duration);
            $("#progress-"+job.identifier).attr('style', "width: "+job.progress+"%");
            $("#progress-"+job.identifier).text(job.progress + "%");
          });
	}
	
        if (finished == true) {
          clearInterval(timerId);
        }
      }
    );
  };

  // refresh job list each 5 secs ...
  timerId = setInterval(function() {
    updateJobs();
  }, 5000); 

});
{'fraction_non_alphanumeric': 0.15876641918903484, 'fraction_numerical': 0.0037121644774414622, 'mean_word_length': 1.8341423948220066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5915452', 'n_tokens_mistral': 1042, 'n_tokens_neox': 990, 'n_words': 195}