This commit is contained in:
2021-01-12 16:27:49 +08:00
parent 81417b6e24
commit f6bbcea9a2
2 changed files with 14 additions and 1 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ namespace HttpServer;
use Exception; use Exception;
use JetBrains\PhpStorm\Pure;
use Snowflake\Abstracts\Input; use Snowflake\Abstracts\Input;
use Snowflake\Exception\ComponentException; use Snowflake\Exception\ComponentException;
use Snowflake\Snowflake; use Snowflake\Snowflake;
@@ -111,7 +112,7 @@ trait Action
/** /**
* @return string * @return string
*/ */
private function getWorkerPath(): string #[Pure] private function getWorkerPath(): string
{ {
return "glob://" . ltrim(APP_PATH, '/') . '/storage/worker/*.sock'; return "glob://" . ltrim(APP_PATH, '/') . '/storage/worker/*.sock';
} }
+12
View File
@@ -228,6 +228,9 @@ class Node extends Application
$handler = [$handler]; $handler = [$handler];
} }
foreach ($handler as $closure) { foreach ($handler as $closure) {
if (in_array($closure, $this->_interceptors)) {
continue;
}
$this->_interceptors[] = $closure; $this->_interceptors[] = $closure;
} }
} }
@@ -243,6 +246,9 @@ class Node extends Application
$handler = [$handler]; $handler = [$handler];
} }
foreach ($handler as $closure) { foreach ($handler as $closure) {
if (in_array($closure, $this->_after)) {
continue;
}
$this->_after[] = $closure; $this->_after[] = $closure;
} }
} }
@@ -258,6 +264,9 @@ class Node extends Application
$handler = [$handler]; $handler = [$handler];
} }
foreach ($handler as $closure) { foreach ($handler as $closure) {
if (in_array($closure, $this->_limits)) {
continue;
}
$this->_limits[] = $closure; $this->_limits[] = $closure;
} }
} }
@@ -403,6 +412,9 @@ class Node extends Application
$class = [$class]; $class = [$class];
} }
foreach ($class as $closure) { foreach ($class as $closure) {
if (in_array($closure, $this->middleware)) {
continue;
}
$this->middleware[] = $closure; $this->middleware[] = $closure;
} }
} }