mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 00:25:35 +08:00
fix worker stop bug and adapter namespace
This commit is contained in:
@@ -17,7 +17,7 @@ use ZM\Exception\PluginException;
|
|||||||
use ZM\Exception\ZMKnownException;
|
use ZM\Exception\ZMKnownException;
|
||||||
use ZM\Framework;
|
use ZM\Framework;
|
||||||
use ZM\Plugin\CommandManual\CommandManualPlugin;
|
use ZM\Plugin\CommandManual\CommandManualPlugin;
|
||||||
use ZM\Plugin\OneBot12Adapter;
|
use ZM\Plugin\OneBot\OneBot12Adapter;
|
||||||
use ZM\Plugin\PluginManager;
|
use ZM\Plugin\PluginManager;
|
||||||
use ZM\Plugin\PluginMeta;
|
use ZM\Plugin\PluginMeta;
|
||||||
use ZM\Process\ProcessStateManager;
|
use ZM\Process\ProcessStateManager;
|
||||||
@@ -116,6 +116,7 @@ class WorkerEventListener
|
|||||||
// 回显 debug 日志:进程占用的内存
|
// 回显 debug 日志:进程占用的内存
|
||||||
$memory_total = memory_get_usage() / 1024 / 1024;
|
$memory_total = memory_get_usage() / 1024 / 1024;
|
||||||
logger()->debug('Worker process used ' . round($memory_total, 3) . ' MB');
|
logger()->debug('Worker process used ' . round($memory_total, 3) . ' MB');
|
||||||
|
logger()->info('已初始化完成');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onWorkerStart1(): void
|
public function onWorkerStart1(): void
|
||||||
@@ -153,10 +154,6 @@ class WorkerEventListener
|
|||||||
if (DIRECTORY_SEPARATOR !== '\\') {
|
if (DIRECTORY_SEPARATOR !== '\\') {
|
||||||
ProcessStateManager::removeProcessState(ProcessStateManager::isTaskWorker() ? ZM_PROCESS_TASKWORKER : ZM_PROCESS_WORKER, ProcessManager::getProcessId());
|
ProcessStateManager::removeProcessState(ProcessStateManager::isTaskWorker() ? ZM_PROCESS_TASKWORKER : ZM_PROCESS_WORKER, ProcessManager::getProcessId());
|
||||||
}
|
}
|
||||||
// 清空 MySQL 的连接池
|
|
||||||
foreach (DBPool::getAllPools() as $name => $pool) {
|
|
||||||
DBPool::destroyPool($name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onWorkerStop1(): void
|
public function onWorkerStop1(): void
|
||||||
|
|||||||
Reference in New Issue
Block a user