改名
This commit is contained in:
@@ -4,10 +4,10 @@
|
|||||||
namespace Snowflake\Crontab;
|
namespace Snowflake\Crontab;
|
||||||
|
|
||||||
|
|
||||||
use Closure;
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use JetBrains\PhpStorm\Pure;
|
use JetBrains\PhpStorm\Pure;
|
||||||
use Snowflake\Abstracts\BaseObject;
|
use Snowflake\Abstracts\BaseObject;
|
||||||
|
use Snowflake\Core\Json;
|
||||||
use Snowflake\Snowflake;
|
use Snowflake\Snowflake;
|
||||||
use Swoole\Timer;
|
use Swoole\Timer;
|
||||||
|
|
||||||
@@ -194,10 +194,10 @@ abstract class Crontab extends BaseObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
abstract public function process(): mixed;
|
abstract public function process(): mixed;
|
||||||
|
|
||||||
abstract public function max_execute(): mixed;
|
abstract public function max_execute(): mixed;
|
||||||
|
|
||||||
abstract public function isStop(): bool;
|
abstract public function isStop(): bool;
|
||||||
|
|
||||||
|
|
||||||
@@ -220,8 +220,11 @@ abstract class Crontab extends BaseObject
|
|||||||
if ($params === null) {
|
if ($params === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$name = date('Y_m_d_H_i_s.' . $this->name . '.log');
|
$name = date('Y-m-d.log');
|
||||||
write(storage($name, '/log/crontab'), serialize($params));
|
write(storage($name, '/log/crontab'), Json::encode([
|
||||||
|
'name' => $this->name,
|
||||||
|
'response' => serialize($params)
|
||||||
|
]));
|
||||||
} catch (\Throwable $throwable) {
|
} catch (\Throwable $throwable) {
|
||||||
logger()->addError($throwable, 'throwable');
|
logger()->addError($throwable, 'throwable');
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ class Zookeeper extends Process
|
|||||||
|
|
||||||
$range = $redis->zRangeByScore(Producer::CRONTAB_KEY, '0', (string)$startTime);
|
$range = $redis->zRangeByScore(Producer::CRONTAB_KEY, '0', (string)$startTime);
|
||||||
$redis->zRemRangeByScore(Producer::CRONTAB_KEY, '0', (string)$startTime);
|
$redis->zRemRangeByScore(Producer::CRONTAB_KEY, '0', (string)$startTime);
|
||||||
print_r($range);
|
|
||||||
|
|
||||||
return [$range, $redis];
|
return [$range, $redis];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user