summaryrefslogtreecommitdiff
path: root/app/Core/Queue
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-07-31 11:28:33 -0400
committerFrederic Guillot <fred@kanboard.net>2016-07-31 11:28:33 -0400
commit92a5a0f8607e136e42e411a8b7aa9e948d3e3611 (patch)
tree4d950fb00b6058d2e8462a432edee44cab88804c /app/Core/Queue
parent92ac133d23cf3447412a6e69f68f2bc2e64ce9cd (diff)
Cleanup events and stuff before processing job in worker
Diffstat (limited to 'app/Core/Queue')
-rw-r--r--app/Core/Queue/JobHandler.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/Core/Queue/JobHandler.php b/app/Core/Queue/JobHandler.php
index 326f3cef..11c1fb69 100644
--- a/app/Core/Queue/JobHandler.php
+++ b/app/Core/Queue/JobHandler.php
@@ -43,8 +43,8 @@ class JobHandler extends Base
try {
$className = $payload['class'];
- $this->memoryCache->flush();
$this->prepareJobSession($payload['user_id']);
+ $this->prepareJobEnvironment();
if (DEBUG) {
$this->logger->debug(__METHOD__.' Received job => '.$className.' ('.getmypid().')');
@@ -75,4 +75,16 @@ class JobHandler extends Base
$this->userSession->initialize($user);
}
}
+
+ /**
+ * Flush in-memory caching and specific events
+ *
+ * @access protected
+ */
+ protected function prepareJobEnvironment()
+ {
+ $this->memoryCache->flush();
+ $this->actionManager->removeEvents();
+ $this->dispatcher->dispatch('app.bootstrap');
+ }
}