no message
This commit is contained in:
parent
080045a48a
commit
069e394990
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use App\Services\Cron\HttpQueue as CronHttpQueue;
|
use App\Services\Cron\HttpQueue as CronHttpQueue;
|
||||||
|
use App\Services\Cron\Book as CronBook;
|
||||||
use App\Services\Cron\ArticleSchema as CronArticleSchema;
|
use App\Services\Cron\ArticleSchema as CronArticleSchema;
|
||||||
use App\Services\TomTool\Telegram\Slave as TeleSlave;
|
use App\Services\TomTool\Telegram\Slave as TeleSlave;
|
||||||
|
|
||||||
@ -28,10 +29,12 @@ final class Cron
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "cron开始执行\n\n";
|
echo "cron开始执行\n\n";
|
||||||
// TeleSlave::log()->enableSlaveQueue(false)->send("master_cron_run:".date("Y-m-d H:i:s"));
|
|
||||||
|
if ($h % 6 === 0) {
|
||||||
|
CronBook::randbox_notify();
|
||||||
|
}
|
||||||
|
|
||||||
if ($i % 3 === 0) {
|
if ($i % 3 === 0) {
|
||||||
// TeleSlave::log()->enableSlaveQueue(false)->send("master_cron_run__hit!!:".date("Y-m-d H:i:s"));
|
|
||||||
CronArticleSchema::cacheTgSave();
|
CronArticleSchema::cacheTgSave();
|
||||||
CronArticleSchema::pushToSlave();
|
CronArticleSchema::pushToSlave();
|
||||||
CronHttpQueue::pop();
|
CronHttpQueue::pop();
|
||||||
|
|||||||
41
app/Services/Cron/Book.php
Normal file
41
app/Services/Cron/Book.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Services\Cron;
|
||||||
|
|
||||||
|
//use App\Services\Cron;
|
||||||
|
use App\Models\Book as ModelBook;
|
||||||
|
//use App\Services\TomTool\Telegram\Master as TelegramMaster;
|
||||||
|
use App\Services\TomTool\Telegram\Slave as TelegramSlave;
|
||||||
|
//use App\Services\TomTool\HttpV2;
|
||||||
|
//use Telegram\Bot\Api;
|
||||||
|
////use Telegram\Bot\Exceptions\TelegramSDKException;
|
||||||
|
//use Telegram\Bot\Exceptions\TelegramSDKException;
|
||||||
|
//use Telegram\Bot\Exceptions\TelegramResponse;Boo
|
||||||
|
|
||||||
|
final class book
|
||||||
|
{
|
||||||
|
|
||||||
|
public static function randbox_notify()
|
||||||
|
{
|
||||||
|
$oBook = ModelBook::where("type", "randbox")->first();
|
||||||
|
|
||||||
|
$sRandBoxPath = $oBook->path.$oBook->id."/";
|
||||||
|
|
||||||
|
$aBookRandbox = ModelBook::where("path", $sRandBoxPath)->where("is_del", 0)->get()->toArray();
|
||||||
|
|
||||||
|
$sRandBoxPathLen = count($aBookRandbox) - 1;
|
||||||
|
|
||||||
|
$iRandKey = rand(0, $sRandBoxPathLen);
|
||||||
|
|
||||||
|
$aGetOne = $aBookRandbox[$iRandKey];
|
||||||
|
|
||||||
|
$sMsg = $aGetOne["rag"];
|
||||||
|
|
||||||
|
TelegramSlave::notify()->send($sMsg);
|
||||||
|
|
||||||
|
tomd($sMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -33,7 +33,7 @@ class Cron extends Base {
|
|||||||
|
|
||||||
$oServicesCron = new ServicesCron();
|
$oServicesCron = new ServicesCron();
|
||||||
|
|
||||||
$oServicesCron->setTestH('00');
|
$oServicesCron->setTestH('06');
|
||||||
$oServicesCron->setTestI('00');
|
$oServicesCron->setTestI('00');
|
||||||
$oServicesCron->setTestS('00');
|
$oServicesCron->setTestS('00');
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user