[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH maposmatic 8/9] Frequency parameters passing imp
From: |
Maxime Petazzoni |
Subject: |
[Maposmatic-dev] [PATCH maposmatic 8/9] Frequency parameters passing improvement |
Date: |
Sun, 24 Jan 2010 14:43:22 +0100 |
---
scripts/daemon.py | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/scripts/daemon.py b/scripts/daemon.py
index be8a2fb..d14cbf6 100755
--- a/scripts/daemon.py
+++ b/scripts/daemon.py
@@ -53,8 +53,9 @@ class MapOSMaticDaemon:
stalls the queue.
"""
- def __init__(self, frequency):
- self.frequency = 10
+ def __init__(self, frequency=_DEFAULT_POLL_FREQUENCY):
+ self.frequency = frequency
+
LOG.info("MapOSMatic rendering daemon started.")
self.rollback_orphaned_jobs()
@@ -115,7 +116,7 @@ class ProcessingMapOSMaticDaemon(MapOSMaticDaemon):
daemon. Each job is handled by a worker process of the pool.
"""
- def __init__(self, frequency, n_workers=None):
+ def __init__(self, frequency=_DEFAULT_POLL_FREQUENCY, n_workers=None):
MapOSMaticDaemon.__init__(self, frequency)
import multiprocessing
@@ -131,7 +132,7 @@ class SubprocessMapOSMaticDaemon(MapOSMaticDaemon):
daemon. Each job is handled by a subprocess from render.py.
"""
- def __init__(self, frequency, max_process=4):
+ def __init__(self, frequency=_DEFAULT_POLL_FREQUENCY, max_process=4):
MapOSMaticDaemon.__init__(self, frequency)
import subprocess
@@ -148,7 +149,7 @@ class RenderingsGarbageCollector(threading.Thread):
of RENDERING_RESULT_MAX_SIZE_GB.
"""
- def __init__(self, frequency=20):
+ def __init__(self, frequency=_DEFAULT_CLEAN_FREQUENCY):
threading.Thread.__init__(self)
self.frequency = frequency
@@ -252,17 +253,14 @@ class RenderingsGarbageCollector(threading.Thread):
if __name__ == '__main__':
- clean_freq = _DEFAULT_CLEAN_FREQUENCY
- poll_freq = _DEFAULT_POLL_FREQUENCY
-
if (not os.path.exists(RENDERING_RESULT_PATH)
or not os.path.isdir(RENDERING_RESULT_PATH)):
LOG.error("%s does not exist or is not a directory! "
"Please use a valid RENDERING_RESULT_PATH.")
sys.exit(1)
- cleaner = RenderingsGarbageCollector(clean_freq)
- daemon = MapOSMaticDaemon(poll_freq)
+ cleaner = RenderingsGarbageCollector()
+ daemon = MapOSMaticDaemon()
cleaner.start()
daemon.serve()
--
1.6.3.3.277.g88938c
- [Maposmatic-dev] MapOSMatic daemon rewrite, Maxime Petazzoni, 2010/01/24
- [Maposmatic-dev] [PATCH maposmatic 1/9] Improve the file cleanup mechanism, Maxime Petazzoni, 2010/01/24
- [Maposmatic-dev] [PATCH maposmatic 2/9] Cornerstones for a new MapOSMatic daemon, Maxime Petazzoni, 2010/01/24
- [Maposmatic-dev] [PATCH maposmatic 3/9] Update the .gitignore list, Maxime Petazzoni, 2010/01/24
- [Maposmatic-dev] [PATCH maposmatic 4/9] Add MAPOSMATIC_LOG_LEVEL to the environment wrapping, Maxime Petazzoni, 2010/01/24
- [Maposmatic-dev] [PATCH maposmatic 5/9] Merge the StandaloneMapOSMaticDaemon into the base MapOSMaticDaemon class, Maxime Petazzoni, 2010/01/24
- [Maposmatic-dev] [PATCH maposmatic 6/9] Revamp the job renderer, Maxime Petazzoni, 2010/01/24
- [Maposmatic-dev] [PATCH maposmatic 7/9] Rework the daemon to use the new JobRenderers, Maxime Petazzoni, 2010/01/24
- [Maposmatic-dev] [PATCH maposmatic 8/9] Frequency parameters passing improvement,
Maxime Petazzoni <=
- [Maposmatic-dev] [PATCH maposmatic 9/9] Provide a map_areas prefix to the TimingOutJobRenderer, Maxime Petazzoni, 2010/01/24