Skip to content

Conversation

@wachterjohannes
Copy link
Member

If an exception occurs in handler or he clears the storage manager (like entityManager in doctrine) the taskRunner should be able to save the entity although.

For example (with doctrine):

  • execution will be loaded
  • handler runs
    • it fails in the middle and has already a few persisted (maybe half entities)
    • it clears the enetityManager
  • TASK_AFTER event will be thrown (new step)
    • EventListener in TaskBundle can clear entityManager
  • execution will be found by execution (new step)
  • execution updated (completed, duration, ...)

Without these new steps the entityManager will throw an error because of the unknown execution entity-object.

new TaskExecutionEvent($execution->getTask(), $execution)
);
} catch (\Exception $ex) {
$execution = $this->taskExecutionRepository->findByUuid($execution->getUuid());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we should add an comment here why findByUuid is called.

@danrot danrot merged commit 685e112 into master Jan 17, 2017
@danrot danrot deleted the bugfix/event-after branch January 17, 2017 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants