From 8b6b5e769bf2b2ff5b9451535d62e2fc971ec95e Mon Sep 17 00:00:00 2001 From: hellcat <> Date: Sun, 4 Jan 2026 20:32:12 +0800 Subject: [PATCH] no message --- app/Services/Cron.php | 32 ++--------------- app/Services/Cron/ArticleLive.php | 59 +++++++++++++++++++++++++++++++ app/Services/Tg/Hook/Mod/Cron.php | 51 ++++++++++++++++++++++++++ public/sub/.gitignore | 2 ++ 4 files changed, 115 insertions(+), 29 deletions(-) create mode 100755 app/Services/Cron/ArticleLive.php create mode 100755 app/Services/Tg/Hook/Mod/Cron.php create mode 100644 public/sub/.gitignore diff --git a/app/Services/Cron.php b/app/Services/Cron.php index 92f5743..bb60d2d 100644 --- a/app/Services/Cron.php +++ b/app/Services/Cron.php @@ -15,6 +15,7 @@ namespace App\Services; //use App\Services\Cron\ArticleSchema as CronArticleSchema; //use App\Services\TomTool\Telegram\Slave as TeleSlave; //use App\Services\Cron\FreenodeSync as CronFreenodeSync; +use App\Services\Cron\ArticleLive as CronArticleLive; final class Cron { @@ -39,35 +40,8 @@ final class Cron echo "cron开始执行 \n"; - if ($h % 8 === 0 && $i === 3) { -// CronBook::randbox_notify(); -// CronFreenodeSync:: - } - - if ($h % 6 === 0 && $i === 3) { -// CronFreenodeCrawl::run(); -// CronFreenodePool::save(); -// CronFreenodeMerge::save(); -// CronFreenodeMerge::baseToSite(); -// CronFreenodeSync::run(); - } - - if ($i % 3 === 0) { -// CronArticleSchema::cacheTgSave(); -// CronArticleSchema::pushToSlave(); -// CronHttpQueue::pop(); - } - - if ($i === 0) { - // ReportSender::handle(); - } - - if ($h == 5 && $i === 3) { -// CronFreenodeFile::clear(); - } - - if ($h == 15 && $i == 3) { -// CronFreenodeLog::fromLast(); + if ($h % 8 === 0 && $i === 10) { + CronArticleLive::client(); } } catch (\Throwable $e) { diff --git a/app/Services/Cron/ArticleLive.php b/app/Services/Cron/ArticleLive.php new file mode 100755 index 0000000..1276eec --- /dev/null +++ b/app/Services/Cron/ArticleLive.php @@ -0,0 +1,59 @@ +orderBy("updated_at", "asc")->first(); + $sUpdatedAtOld = (string) $oArticleClient->updated_at; + $oArticleClient->updated_at = time(); + $oArticleClient->save(); + + $aData["ArticleLive::client() - ok"] = [ + "code" => $oArticleClient->code, + "title" => $oArticleClient->title, + "update_at" => (string) $oArticleClient->updated_at, + "update_at::old" => $sUpdatedAtOld, + ]; + + tomd($aData); + + TeleSlave::log()->enableSlaveQueue(false)->send($aData); + + echo "\n - ok"; + } + +} diff --git a/app/Services/Tg/Hook/Mod/Cron.php b/app/Services/Tg/Hook/Mod/Cron.php new file mode 100755 index 0000000..ab71cd1 --- /dev/null +++ b/app/Services/Tg/Hook/Mod/Cron.php @@ -0,0 +1,51 @@ +setTestH('06'); + $oServicesCron->setTestI('10'); + $oServicesCron->setTestS('00'); + + if ($sType == "h") { + $oServicesCron->setTestH($sValue); + } else if ($sType == "i") { + $oServicesCron->setTestI($sValue); + } else if ($sType == "s") { + $oServicesCron->setTestS($sValue); + } + + return $oServicesCron->run(); + } + +} diff --git a/public/sub/.gitignore b/public/sub/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/public/sub/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore