mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-18 17:00:06 +08:00
[fix] Corrected Version fixed #209
This commit is contained in:
parent
b206737a94
commit
2ee4ca5ed2
@ -37,21 +37,20 @@
|
||||
"ext-json": "*",
|
||||
"ext-zlib": "*",
|
||||
"ext-mbstring": "*",
|
||||
"monolog/monolog": "2.x-dev",
|
||||
"monolog/monolog": "dev-main",
|
||||
"bramus/monolog-colored-line-formatter": "dev-master",
|
||||
"symfony/yaml": "6.1.x-dev",
|
||||
"symfony/yaml": "^6.0",
|
||||
"toolkit/stdlib": "*",
|
||||
"adhocore/cli": "dev-main",
|
||||
"lkeme/data": "4.x-dev",
|
||||
"grasmash/expander": "dev-main",
|
||||
"amphp/amp": "^2.6.2",
|
||||
"amphp/amp": "3.x-dev",
|
||||
"fire015/flintstone": "dev-master",
|
||||
"overtrue/pinyin": "dev-master",
|
||||
"guzzlehttp/guzzle": "^7.4",
|
||||
"toolkit/pflag": "^2.0",
|
||||
"symfony/console": "^6.1",
|
||||
"malios/php-to-ascii-table": "^3.0",
|
||||
"clue/socket-raw": "1.6"
|
||||
"guzzlehttp/guzzle": "dev-master",
|
||||
"toolkit/pflag": "dev-main",
|
||||
"symfony/console": "^6.0",
|
||||
"malios/php-to-ascii-table": "dev-master"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@ -594,6 +594,7 @@ class Login extends BasePlugin
|
||||
* @param string $cid
|
||||
* @param string $validate
|
||||
* @param string $challenge
|
||||
* @param string $recaptcha_token
|
||||
* @return array
|
||||
*/
|
||||
protected function sendSms(string $phone, string $cid, string $validate = '', string $challenge = '', string $recaptcha_token = ''): array
|
||||
|
||||
@ -17,24 +17,26 @@
|
||||
|
||||
namespace Bhp\Task;
|
||||
|
||||
use Amp\Loop;
|
||||
use Amp\Future;
|
||||
use Bhp\Log\Log;
|
||||
use Bhp\Plugin\Plugin;
|
||||
use Bhp\Schedule\Schedule;
|
||||
use Bhp\TimeLock\TimeLock;
|
||||
use Bhp\Util\DesignPattern\SingleTon;
|
||||
use Bhp\Util\Exceptions\NoLoginException;
|
||||
use Throwable;
|
||||
use function Amp\asyncCall;
|
||||
use function Amp\async;
|
||||
use function Amp\delay;
|
||||
|
||||
|
||||
class Task extends SingleTon
|
||||
{
|
||||
private static array $promises;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function init(): void
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -44,7 +46,7 @@ class Task extends SingleTon
|
||||
*/
|
||||
public static function addTask(string $hook, mixed ...$data): void
|
||||
{
|
||||
asyncCall(function () use ($hook, $data) {
|
||||
self::$promises[] = async(function () use ($hook, $data) {
|
||||
while (true) {
|
||||
try {
|
||||
Plugin::getInstance()->trigger($hook, ...$data);
|
||||
@ -59,7 +61,7 @@ class Task extends SingleTon
|
||||
Log::error($error_msg);
|
||||
// Notice::push('error', $error_msg);
|
||||
}
|
||||
yield TimeLock::Delayed();
|
||||
delay(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -69,7 +71,7 @@ class Task extends SingleTon
|
||||
*/
|
||||
public static function execTasks(): void
|
||||
{
|
||||
Loop::run();
|
||||
Future\awaitAll(self::$promises);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
|
||||
namespace Bhp\TaskQueue;
|
||||
|
||||
use Amp\Delayed;
|
||||
use Bhp\Util\DesignPattern\SingleTon;
|
||||
|
||||
class TaskQueue extends SingleTon
|
||||
@ -92,7 +91,6 @@ class TaskQueue extends SingleTon
|
||||
|
||||
/**
|
||||
* 获取调用者类名
|
||||
* @param int $index
|
||||
* @return string
|
||||
*/
|
||||
protected function getCallClassName(): string
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
|
||||
namespace Bhp\TimeLock;
|
||||
|
||||
use Amp\Delayed;
|
||||
use Bhp\Schedule\Schedule;
|
||||
use Bhp\Util\DesignPattern\SingleTon;
|
||||
|
||||
@ -106,15 +105,15 @@ class TimeLock extends SingleTon
|
||||
return $this->locks[$class_name];
|
||||
}
|
||||
|
||||
/**
|
||||
* used in Amp loop Delayed
|
||||
* @param int $times
|
||||
* @return Delayed
|
||||
*/
|
||||
public static function Delayed(int $times=1000): Delayed
|
||||
{
|
||||
return new Delayed($times);
|
||||
}
|
||||
// /**
|
||||
// * used in Amp loop Delayed
|
||||
// * @param int $times
|
||||
// * @return Delayed
|
||||
// */
|
||||
// public static function Delayed(int $times=1000): Delayed
|
||||
// {
|
||||
// return new Delayed($times);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 定时
|
||||
|
||||
Loading…
Reference in New Issue
Block a user