Skip to content
Snippets Groups Projects
Commit 02b6f053 authored by Luca Scarabello's avatar Luca Scarabello
Browse files

Improved failed template loading

parent 9b408e47
No related branches found
Tags v0.6.3
No related merge requests found
......@@ -37,4 +37,5 @@ class TemplateManager(SequentialLoader):
def set_unloadable(self, template):
self.remove(template)
del self.map[template]
......@@ -195,16 +195,6 @@ class TemplateMatching(object):
elif os.path.isfile(errorchunks_file):
os.remove(errorchunks_file)
errortemplates_file = os.path.join(self.config.directory, 'errorTemplates.dat')
if self.failed_templates:
def failed_templates_to_row(template):
return {'Template':template}
columns = [('Template',0)]
tmio.save_iter_to_file(self.failed_templates, errortemplates_file,
failed_templates_to_row, columns)
elif os.path.isfile(errortemplates_file):
os.remove(errortemplates_file)
def __user_info(self):
"""
Inform user of the current status
......@@ -280,11 +270,6 @@ class TemplateMatching(object):
# Stop the execution if we had problem loading templates
if self.failed_templates:
ftemplate = self.failed_templates[0]
start, shift, mag = self.template_mngr.get_template(ftemplate)
self.logger.error("Error: couldn't load template for time '%s'. To continue either "
"delete/comment the event from catalog to exclude it or fix the "
"waveform archive so that the template can be loaded." % (start))
break
# We have finished, save last time
......@@ -307,10 +292,13 @@ class TemplateMatching(object):
for l in self.m_template_ldr.get_completed():
template, error = self.m_template_ldr.get_data(l)
if error:
start, shift, mag = self.template_mngr.get_template(template)
self.logger.error("Error: couldn't load template for time '%s'. To continue either "
"delete/comment the event from catalog to exclude it or fix the "
"waveform archive so that the template can be loaded." % (start))
self.template_mngr.set_unloadable(template)
self.scanner_mngr.remove_template(template) # useful when continuing previous run
self.failed_templates.append(template)
self.logger.warning('(Error) Loading template %d' % (template) )
else:
self.template_mngr.set_loaded(template)
self.scanner_mngr.add_template_to_process(template)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment