Skip to content
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

Multiple concurrent runs of the same task #16

Closed
lars85 opened this issue Nov 20, 2016 · 1 comment · Fixed by #30
Closed

Multiple concurrent runs of the same task #16

lars85 opened this issue Nov 20, 2016 · 1 comment · Fixed by #30

Comments

@lars85
Copy link
Contributor

lars85 commented Nov 20, 2016

If a task runs longer than a minute, it will be started again and again (with each "runCommand" execution) until the first one is stopped (and the last execution time is written).

One (maybe dirty) fix would be:
\Ttree\Scheduler\Command\TaskCommandController::runCommand
Switch both lines:
first: write the last execution time
$this->taskService->update($task, $taskDescriptor['type']);
then: execute the task
$task->execute($this->objectManager);

Let me know what the perfect solution would be and I can help to develop it (if you need help).

PS:

  • allowParallelExecution of the same task (and not in general) as an option for a task would be cool as feature.

  • looking forward to "Asynchronous task handling or multi thread (pthread support)" :-) 👍

@simstern
Copy link
Contributor

simstern commented Aug 16, 2019

I have exactly the same issue.

I've been also thinking of solving it by implementing allowParallelExecution on task level in combination with a status flag running which is also a suggestion here: #15

@dfeyer does this makes sense? If yes, I'm happy to add this.

Edit: I kind of realised that it's not that simple to implement this two features nicely. Therefore I just fixed the main issue here. See PR #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants