Merge pull request #235 from zhamao-robot/chore-updates

修复一些小问题和添加 GitAttributes
This commit is contained in:
sunxyw 2023-01-04 16:18:53 +08:00 committed by GitHub
commit 4d6fc097c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 2 deletions

21
.gitattributes vendored Normal file
View 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

View File

@ -24,6 +24,7 @@ jobs:
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Code Style
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3

View File

@ -24,6 +24,7 @@ jobs:
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Static Analysis
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3

View File

@ -36,6 +36,7 @@ jobs:
php-version: [ 8.0, 8.1, 8.2 ]
name: PHP ${{ matrix.php-version }} Test (${{ matrix.operating-system }})
runs-on: ${{ matrix.operating-system }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3

0
bin/prepare-doxygen Normal file → Executable file
View File

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace ZM\Event\Listener;
use OneBot\Driver\Coroutine\Adaptive;
use OneBot\Driver\Coroutine\CoroutineInterface;
use OneBot\Driver\Process\ProcessManager;
use OneBot\Util\Singleton;
use ZM\Annotation\AnnotationHandler;
@ -96,9 +97,13 @@ class WorkerEventListener
$this->initUserPlugins();
// handle @Init annotation
Adaptive::getCoroutine()->create(function () {
if (Adaptive::getCoroutine() instanceof CoroutineInterface) {
Adaptive::getCoroutine()->create(function () {
$this->dispatchInit();
});
} else {
$this->dispatchInit();
});
}
// 回显 debug 日志:进程占用的内存
$memory_total = memory_get_usage() / 1024 / 1024;
logger()->debug('Worker process used ' . round($memory_total, 3) . ' MB');