This commit is contained in:
2021-04-14 14:46:55 +08:00
parent a672522d3b
commit b4a06d8f4b
2 changed files with 7 additions and 5 deletions
+7 -4
View File
@@ -4,10 +4,10 @@
namespace Snowflake\Crontab;
use Closure;
use Exception;
use JetBrains\PhpStorm\Pure;
use Snowflake\Abstracts\BaseObject;
use Snowflake\Core\Json;
use Snowflake\Snowflake;
use Swoole\Timer;
@@ -194,10 +194,10 @@ abstract class Crontab extends BaseObject
}
abstract public function process(): mixed;
abstract public function max_execute(): mixed;
abstract public function isStop(): bool;
@@ -220,8 +220,11 @@ abstract class Crontab extends BaseObject
if ($params === null) {
return;
}
$name = date('Y_m_d_H_i_s.' . $this->name . '.log');
write(storage($name, '/log/crontab'), serialize($params));
$name = date('Y-m-d.log');
write(storage($name, '/log/crontab'), Json::encode([
'name' => $this->name,
'response' => serialize($params)
]));
} catch (\Throwable $throwable) {
logger()->addError($throwable, 'throwable');
} finally {