check number of generated files, report success only if at leat one

user-mgmt
Hartmut Holzgraefe 2021-12-26 17:32:37 +00:00
rodzic deb8e90396
commit d060a758ea
1 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -505,7 +505,7 @@ class JobRenderer(threading.Thread):
output_formats = \
list(set(compatible_output_formats) & set(RENDERING_RESULT_FORMATS))
renderer.render(config, self.job.layout,
output_count = renderer.render(config, self.job.layout,
output_formats, result_file_prefix)
# Create thumbnail
@ -515,8 +515,14 @@ class JobRenderer(threading.Thread):
except:
pass
self.result = RESULT_SUCCESS
LOG.info("Finished rendering of job #%d." % self.job.id)
if output_count > 0:
self.result = RESULT_SUCCESS
LOG.info("Finished rendering of job #%d." % self.job.id)
# TODO log if some formats failed
else:
self.result = RESULT_RENDERING_EXCEPTION
LOG.exception("Rendering of job #%d faild, no output files generated" % self.job.id)
return self.result
except KeyboardInterrupt:
self.result = RESULT_KEYBOARD_INTERRUPT
LOG.info("Rendering of job #%d interrupted!" % self.job.id)