summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Core/Action/ActionManager.php16
-rw-r--r--app/Core/Queue/JobHandler.php14
-rw-r--r--app/Locale/zh_CN/translations.php2
3 files changed, 30 insertions, 2 deletions
diff --git a/app/Core/Action/ActionManager.php b/app/Core/Action/ActionManager.php
index 1dfd820c..aec9ef02 100644
--- a/app/Core/Action/ActionManager.php
+++ b/app/Core/Action/ActionManager.php
@@ -139,4 +139,20 @@ class ActionManager extends Base
return $this;
}
+
+ /**
+ * Remove all listeners for automated actions
+ *
+ * @access public
+ */
+ public function removeEvents()
+ {
+ foreach ($this->dispatcher->getListeners() as $eventName => $listeners) {
+ foreach ($listeners as $listener) {
+ if (is_array($listener) && $listener[0] instanceof ActionBase) {
+ $this->dispatcher->removeListener($eventName, $listener);
+ }
+ }
+ }
+ }
}
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');
+ }
}
diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php
index a4adece7..b4e9c063 100644
--- a/app/Locale/zh_CN/translations.php
+++ b/app/Locale/zh_CN/translations.php
@@ -105,7 +105,7 @@ return array(
'Add a new task' => '添加新任务',
'The username is required' => '需要用户名',
'The maximum length is %d characters' => '最长%d个英文字符',
- 'The minimum length is %d characters' => '最短%d个英文自负',
+ 'The minimum length is %d characters' => '最短%d个英文字符',
'The password is required' => '需要密码',
'This value must be an integer' => '该值必须为整数',
'The username must be unique' => '用户名必须唯一',