Skip to content

Refind execution after handle run and added task-after event #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2017

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.

@@ -84,6 +79,7 @@ public function runTasks()
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.

3 participants