Commit 98f28bc3 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

fixed improper updating of job statistics in case a processing level has been skipped.

misc.process_controller-process_controller:
- run_all_processors(): added job statistics updater after checking local availability
- added update_DB_job_statistics()

- updated __version__


Former-commit-id: 7f7383ab
parent e859d44d
......@@ -15,7 +15,7 @@ from . import config
from .processing.process_controller import process_controller
__version__ = '20170330.02'
__version__ = '20170330.03'
__author__ = 'Daniel Scheffler'
__all__ = ['algorithms',
'io',
......
......@@ -28,7 +28,7 @@ from .pipeline import (L1A_map, L1A_map_1, L1A_map_2, L1A_map_3, L
L2A_map, L2B_map, L2C_map)
from ..config import set_config, GMS_config
from .multiproc import MAP
from ..misc.definition_dicts import proc_chain
from ..misc.definition_dicts import proc_chain, db_jobs_statistics_def
class process_controller(object):
......@@ -339,6 +339,7 @@ class process_controller(object):
"""
Run all processors at once.
"""
signal.signal(signal.SIGINT, self.stop) # enable clean shutdown possibility
try:
......@@ -360,6 +361,7 @@ class process_controller(object):
# add local availability
self.usecase.data_list = MAP(self.add_local_availability, self.usecase.data_list)
self.update_DB_job_statistics(self.usecase.data_list)
self.L1A_processing()
self.L1B_processing()
......@@ -623,6 +625,7 @@ class process_controller(object):
"""
Update the database records of the current job (table 'jobs').
"""
# TODO move this method to config.Job
# update 'failed_sceneids' column of job record within jobs table
sceneids_failed = list(set([obj.scene_ID for obj in self.failed_objects]))
DB_T.update_records_in_postgreSQLdb(
......@@ -633,6 +636,19 @@ class process_controller(object):
{'id': self.job.ID})
def update_DB_job_statistics(self, usecase_datalist):
"""
Update job statistics of the running job in the database.
"""
# TODO move this method to config.Job
for ds in usecase_datalist:
if ds['proc_level'] is not None:
DB_T.increment_decrement_arrayCol_in_postgreSQLdb(
self.job.conn_database, 'jobs', 'statistics', cond_dict={'id': self.job.ID},
idx_val2decrement=db_jobs_statistics_def['downloaded'],
idx_val2increment=db_jobs_statistics_def[ds['proc_level']])
def create_job_summary(self):
"""
Create job success summary
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment