mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 08:35:35 +08:00
Merge pull request #235 from zhamao-robot/chore-updates
修复一些小问题和添加 GitAttributes
This commit is contained in:
21
.gitattributes
vendored
Normal file
21
.gitattributes
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Exclude build/test files from archive (reduce package size)
|
||||||
|
/.github export-ignore
|
||||||
|
/.phive export-ignore
|
||||||
|
/build export-ignore
|
||||||
|
/docs export-ignore
|
||||||
|
/ext export-ignore
|
||||||
|
/resources export-ignore
|
||||||
|
/tests export-ignore
|
||||||
|
/tests_old export-ignore
|
||||||
|
/.editorconfig export-ignore
|
||||||
|
/.gitattributes export-ignore
|
||||||
|
/.gitignore export-ignore
|
||||||
|
/.php-cs-fixer.php export-ignore
|
||||||
|
/captainhook.json export-ignore
|
||||||
|
/install-runtime.sh export-ignore
|
||||||
|
/package.json export-ignore
|
||||||
|
/phpstan.neon export-ignore
|
||||||
|
/phpunit.xml.dist export-ignore
|
||||||
|
|
||||||
|
# Configure diff output
|
||||||
|
*.php diff=php
|
||||||
1
.github/workflows/coding-style.yml
vendored
1
.github/workflows/coding-style.yml
vendored
@@ -24,6 +24,7 @@ jobs:
|
|||||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
||||||
name: Code Style
|
name: Code Style
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|||||||
1
.github/workflows/static-analysis.yml
vendored
1
.github/workflows/static-analysis.yml
vendored
@@ -24,6 +24,7 @@ jobs:
|
|||||||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
|
||||||
name: Static Analysis
|
name: Static Analysis
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|||||||
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
@@ -36,6 +36,7 @@ jobs:
|
|||||||
php-version: [ 8.0, 8.1, 8.2 ]
|
php-version: [ 8.0, 8.1, 8.2 ]
|
||||||
name: PHP ${{ matrix.php-version }} Test (${{ matrix.operating-system }})
|
name: PHP ${{ matrix.php-version }} Test (${{ matrix.operating-system }})
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|||||||
0
bin/prepare-doxygen
Normal file → Executable file
0
bin/prepare-doxygen
Normal file → Executable file
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace ZM\Event\Listener;
|
namespace ZM\Event\Listener;
|
||||||
|
|
||||||
use OneBot\Driver\Coroutine\Adaptive;
|
use OneBot\Driver\Coroutine\Adaptive;
|
||||||
|
use OneBot\Driver\Coroutine\CoroutineInterface;
|
||||||
use OneBot\Driver\Process\ProcessManager;
|
use OneBot\Driver\Process\ProcessManager;
|
||||||
use OneBot\Util\Singleton;
|
use OneBot\Util\Singleton;
|
||||||
use ZM\Annotation\AnnotationHandler;
|
use ZM\Annotation\AnnotationHandler;
|
||||||
@@ -96,9 +97,13 @@ class WorkerEventListener
|
|||||||
$this->initUserPlugins();
|
$this->initUserPlugins();
|
||||||
|
|
||||||
// handle @Init annotation
|
// handle @Init annotation
|
||||||
Adaptive::getCoroutine()->create(function () {
|
if (Adaptive::getCoroutine() instanceof CoroutineInterface) {
|
||||||
|
Adaptive::getCoroutine()->create(function () {
|
||||||
|
$this->dispatchInit();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
$this->dispatchInit();
|
$this->dispatchInit();
|
||||||
});
|
}
|
||||||
// 回显 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');
|
||||||
|
|||||||
Reference in New Issue
Block a user