webman-task安装后报错

sanye

问题描述

组件yzh52521/webman-task
安装后什么都没干,就出现了以下错误:

ArgumentCountError: Too few arguments to function yzh52521\Task\Mutex\RedisTaskMutex::__construct(), 0 passed in /www/wwwroot/hantuzt/vendor/workerman/webman-framework/src/Container.php on line 41 and exactly 1 expected in /www/wwwroot/hantuzt/vendor/yzh52521/webman-task/src/Mutex/RedisTaskMutex.php:17
Stack trace:
#0 /www/wwwroot/hantuzt/vendor/workerman/webman-framework/src/Container.php(41): yzh52521\Task\Mutex\RedisTaskMutex->__construct()
#1 /www/wwwroot/hantuzt/vendor/workerman/webman-framework/src/support/Container.php(46): Webman\Container->get()
#2 /www/wwwroot/hantuzt/vendor/yzh52521/webman-task/src/Server.php(538): support\Container::__callStatic()
#3 /www/wwwroot/hantuzt/vendor/yzh52521/webman-task/src/Server.php(501): yzh52521\Task\Server->getTaskMutex()
#4 /www/wwwroot/hantuzt/vendor/yzh52521/webman-task/src/Server.php(527): yzh52521\Task\Server->runInSingleton()
#5 /www/wwwroot/hantuzt/vendor/yzh52521/webman-task/src/Server.php(248): yzh52521\Task\Server->decorateRunnable()
#6 /www/wwwroot/hantuzt/vendor/yzh52521/webman-task/src/Server.php(165): yzh52521\Task\Server->crontabRun()
#7 /www/wwwroot/hantuzt/vendor/yzh52521/webman-task/src/Server.php(110): yzh52521\Task\Server->crontabInit()
#8 /www/wwwroot/hantuzt/support/helpers.php(432): yzh52521\Task\Server->onWorkerStart()
#9 /www/wwwroot/hantuzt/support/helpers.php(470): worker_bind()
#10 /www/wwwroot/hantuzt/vendor/workerman/workerman/Worker.php(2494): {closure}()
#11 /www/wwwroot/hantuzt/vendor/workerman/workerman/Worker.php(1633): Workerman\Worker->run()
#12 /www/wwwroot/hantuzt/vendor/workerman/workerman/Worker.php(1426): Workerman\Worker::forkOneWorkerForLinux()
#13 /www/wwwroot/hantuzt/vendor/workerman/workerman/Worker.php(1400): Workerman\Worker::forkWorkersForLinux()
#14 /www/wwwroot/hantuzt/vendor/workerman/workerman/Worker.php(1785): Workerman\Worker::forkWorkers()
#15 /www/wwwroot/hantuzt/vendor/workerman/workerman/Worker.php(1721): Workerman\Worker::monitorWorkersForLinux()
#16 /www/wwwroot/hantuzt/vendor/workerman/workerman/Worker.php(562): Workerman\Worker::monitorWorkers()
#17 /www/wwwroot/hantuzt/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()
#18 /www/wwwroot/hantuzt/start.php(4): support\App::run()
#19 {main}
worker[plugin.yzh52521.task.cron_task:22469] exit with status 64000
762 1 0
1个回答

sanye

整出来了
安装了这个组件后,一定要安装【依赖自动注入】
https://www.workerman.net/doc/webman/di.html
并严格修改container

上述问题即可解决

  • Gin 2023-10-13

    一眼看出是 di的错误, 因为我之前也是这

年代过于久远,无法发表回答
×
🔝