diff options
author | Michal Minar <miminar@redhat.com> | 2013-07-09 12:49:00 +0200 |
---|---|---|
committer | Michal Minar <miminar@redhat.com> | 2013-07-23 13:52:35 +0200 |
commit | cc695fa0cf0f46b04e1e9a4ea34767721d48eb63 (patch) | |
tree | a4aa3d6cf861f83e55cb6f7176775357d16a721a /src | |
parent | 2053c1b1986688525c2e3fa171e0135dda178d40 (diff) | |
download | openlmi-providers-cc695fa0cf0f46b04e1e9a4ea34767721d48eb63.tar.gz openlmi-providers-cc695fa0cf0f46b04e1e9a4ea34767721d48eb63.tar.xz openlmi-providers-cc695fa0cf0f46b04e1e9a4ea34767721d48eb63.zip |
software: minimum time before job's removal configurable
supported another option in software's configuration
Diffstat (limited to 'src')
-rw-r--r-- | src/software/lmi/software/yumdb/jobmanager.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/software/lmi/software/yumdb/jobmanager.py b/src/software/lmi/software/yumdb/jobmanager.py index 751c7d1..4c9d90a 100644 --- a/src/software/lmi/software/yumdb/jobmanager.py +++ b/src/software/lmi/software/yumdb/jobmanager.py @@ -44,15 +44,13 @@ from lmi.common.JobManager import JobManager as JM from lmi.software.yumdb import errors from lmi.software.yumdb import jobs from lmi.software.util import cmpi_logging +from lmi.software.util import Configuration # This is a callable, which must be initialized before JobManager is used. # It should be a pointer to function, which takes a job and returns # corresponding CIM instance. It's used for sending indications. JOB_TO_MODEL = lambda job: None -# Minimum time to keep asynchronous job in cache after completion. In seconds. -MINIMUM_TIME_BEFORE_REMOVAL = 10 - # replacement for cmpi_logging.logger LOG = None @@ -498,8 +496,9 @@ class JobManager(threading.Thread): job.finish(result, result_data) if getattr(job, 'async', False): if job.delete_on_completion: - schedule_at = max( job.time_before_removal - , MINIMUM_TIME_BEFORE_REMOVAL) + default = Configuration.get_instance().get_safe( + 'Log', 'MinimumTimeBeforeRemoval', float) + schedule_at = max(job.time_before_removal, default) self._schedule_event(schedule_at, job.jobid, self.ACTION_REMOVE) if result == job.RESULT_SUCCESS: |