Revision 57f8615f

b/lib/jqueue.py
436 436
    logging.debug("Writing job %s to %s", job.id, filename)
437 437
    utils.WriteFile(filename,
438 438
                    data=serializer.DumpJson(job.Serialize(), indent=False))
439
    self._CleanCacheUnlocked(exceptions=[job.id])
439
    self._CleanCacheUnlocked([job.id])
440 440

  
441
  def _CleanCacheUnlocked(self, exceptions=None):
441
  def _CleanCacheUnlocked(self, exclude):
442 442
    """Clean the memory cache.
443 443

  
444 444
    The exceptions argument contains job IDs that should not be
445 445
    cleaned.
446 446

  
447 447
    """
448
    assert isinstance(exceptions, list)
448
    assert isinstance(exclude, list)
449 449
    for job in self._memcache.values():
450
      if job.id in exceptions:
450
      if job.id in exclude:
451 451
        continue
452 452
      if job.GetStatus() not in (constants.JOB_STATUS_QUEUED,
453 453
                                 constants.JOB_STATUS_RUNNING):

Also available in: Unified diff