Esempio n. 1
0
 def _exec_threaded(instance, abort):
     outer_handlers = get_thread_handlers()
     task_id = instance.id
     def thread_wrapped_task():
         with inner_thread_nested_setup(outer_handlers):
             try:
                 # Reload from db
                 from kettle.tasks import Task
                 task = Task._from_id(task_id)
                 getattr(task, method_name)()
             except Exception:
                 # TODO: Fix logging
                 print traceback.format_exc()
                 logbook.exception()
                 abort.set()
     thread = ExcRecordingThread(target=thread_wrapped_task, name=instance.__class__.__name__)
     thread.start()
     return thread
Esempio n. 2
0
 def log_setup_action(self, action):
     return NestedSetup(
             get_thread_handlers() +
             (FileHandler(log_filename(
                 self.rollout_id, self.id, action), bubble=True),))