no message
This commit is contained in:
parent
969dc8bd64
commit
eadcc52521
@ -42,38 +42,38 @@ final class Cron
|
||||
echo "cron开始执行 \n";
|
||||
|
||||
if ($h % 8 === 0 && $i === 3) {
|
||||
CronBook::randbox_notify();
|
||||
CronBook::randbox_notify(); // note提醒
|
||||
}
|
||||
|
||||
if ($h % 6 === 0 && $i === 3) {
|
||||
CronFreenodeCrawl::run();
|
||||
CronFreenodePool::save();
|
||||
CronFreenodeMerge::save();
|
||||
CronFreenodeMerge::baseToSite();
|
||||
CronFreenodeCrawl::run(); // 1.爬免费节点
|
||||
CronFreenodePool::save(); // 2.格式化入库
|
||||
CronFreenodeMerge::save(); // 3.加工成文件
|
||||
CronFreenodeMerge::baseToSite(); // 4.文件分散为各站用
|
||||
}
|
||||
|
||||
if ($h % 3 === 0 && $i === 3) {
|
||||
CronFreenodeSync::run();
|
||||
CronFreenodeSync::nodehub();
|
||||
CronFreenodeSync::run(); // fn分发到各到各站,旧版
|
||||
CronFreenodeSync::nodehub(); // fn分到到nodehub
|
||||
}
|
||||
|
||||
if ($h == 11 && $i == 3) {
|
||||
CronFnSitePublish::fn_b();
|
||||
CronFnSitePublish::fn_b(); // 新版,直接生成完整fn文章推到各站
|
||||
}
|
||||
|
||||
if ($h == 5 && $i === 3) {
|
||||
CronFreenodeFile::clear();
|
||||
CronFreenodeFile::clear(); // 清理fn
|
||||
}
|
||||
|
||||
if ($h == 13 && $i == 3) { // 中午12点03发布fn的tg
|
||||
CronFnTgPublish::run();
|
||||
CronFnTgPublish::run_b();
|
||||
CronFnTgPublish::run(); // fn发布tg频道
|
||||
CronFnTgPublish::run_b(); // 新版,fn发布tg频道
|
||||
}
|
||||
|
||||
if ($i % 3 === 0) {
|
||||
echo ServiceCacheTg::cron_saveToSchema();
|
||||
CronArticleSchema::cacheTgSave();
|
||||
CronArticleSchema::pushToSlave();
|
||||
ServiceCacheTg::cron_saveToSchema(); // 文章从tg接收
|
||||
CronArticleSchema::cacheTgSave(); // 文章入库
|
||||
CronArticleSchema::pushToSlave(); // 文章发送到各站
|
||||
CronHttpQueue::pop();
|
||||
}
|
||||
|
||||
|
||||
@ -56,68 +56,13 @@ final class FreenodeSync
|
||||
echo " - ok \n";
|
||||
}
|
||||
|
||||
// static function nodehub()
|
||||
// {
|
||||
// echo "\nFeenodeSync::nodehub() - 开始 \n";
|
||||
//
|
||||
// $sDirBase = $_ENV["dir_base"];
|
||||
//
|
||||
// $oNodehub = ModelSiteMap::where("group_code", "nodehub")->first();
|
||||
// $oFnSiteList = ModelSiteMap::where("group_code", "fn_b")->get();
|
||||
//// tomd($oNodehub, 1);
|
||||
// $aResultAll = [];
|
||||
// foreach ($oFnSiteList as $oFnSite) {
|
||||
//
|
||||
// $aSiteConfig = json_decode($oFnSite->config, true);
|
||||
// $aSiteConfigFnClient = $aSiteConfig["freenode_client"] ?? [];
|
||||
// $aSiteApi = json_decode($oFnSite->api_path, true);
|
||||
// $sSiteApiFreenodeReceive = $aSiteApi["freenode_receive"] ?? "";
|
||||
//
|
||||
// $aFnContent = [];
|
||||
// foreach ($aSiteConfigFnClient as $aSiteConfigFnClientRow) {
|
||||
// $sFilePath = $sDirBase."public/freenode/merge/".$oFnSite->code."/".$aSiteConfigFnClientRow."/".date("Y-m-d").".txt";
|
||||
//
|
||||
// if (!file_exists($sFilePath)) {
|
||||
// $sMsg = "freenodeSync的run没有当天文件".$sFilePath;
|
||||
// TeleSlave::warn()->send($sMsg);
|
||||
// echo "\n - ".$sMsg;
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// $aFnContent[$aSiteConfigFnClientRow] = file_get_contents($sFilePath);
|
||||
//
|
||||
// }
|
||||
////tomd($aFnContent, 1);
|
||||
// $sApiUrl = "https://".$oFnSite->url."/".$sSiteApiFreenodeReceive; //// test
|
||||
// $sResult = HttpV2::make($sApiUrl, "post")->setDataA($aFnContent)->enableJsonSend()->send();
|
||||
// $aResult = json_decode($sResult, true);
|
||||
//
|
||||
// if (!isset($aResult["isDone"]) || $aResult["isDone"] != true) {
|
||||
// $sMsg = "freenodeSync::同步失败 ->".$oFnSite->name;
|
||||
// echo $sMsg.$sResult;
|
||||
// TeleSlave::warn()->setMsgS($sMsg)->send();
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// if (isset($aResult["sMsg"])) {
|
||||
// $sMsg = json_encode($aResult["sMsg"]);
|
||||
// TeleSlave::notify()->setMsgS($sMsg)->send();
|
||||
// } else {
|
||||
// TeleSlave::log()->setMsgS("nodehub同步完成")->send();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// echo " - 完成 \n";
|
||||
// }
|
||||
|
||||
static function nodehub()
|
||||
{
|
||||
echo "\nFeenodeSync::nodehub() - 开始 \n";
|
||||
|
||||
$sDirBase = $_ENV["dir_base"];
|
||||
|
||||
$oFnSiteList = ModelSiteMap::where("group_code", "fn_b")->get();
|
||||
$oFnSiteList = ModelSiteMap::whereIn("group_code", ["fn_b", "fn_a"])->get();
|
||||
$oSiteNodehub = ModelSiteMap::where("code", "nodehub")->first();
|
||||
$aSiteNodehubConfig = json_decode($oSiteNodehub->config ?? '', true);
|
||||
|
||||
|
||||
@ -701,6 +701,38 @@ class Dog extends Mod\Base {
|
||||
return $this->set($aParam);
|
||||
}
|
||||
|
||||
public function jsonSet($aParam)
|
||||
{
|
||||
$iId = $aParam["aOption"][1] ?? "";
|
||||
$sField = $aParam["aOption"][2] ?? "";
|
||||
$aJson = $aParam["aArg"];
|
||||
$sJson = implode(" ", $aJson);
|
||||
$aJson = json_decode($sJson, true);
|
||||
|
||||
if ($sJson == "?") {
|
||||
return "#jsonSet__[id]__[field] [json]";
|
||||
}
|
||||
|
||||
if (!$iId || !$sField || !$sJson) {
|
||||
return "参数不足";
|
||||
}
|
||||
|
||||
$oModelSelf = $this->oModelSelf->where("id", $iId)->first();
|
||||
|
||||
if (!$oModelSelf) {
|
||||
return "没有这个";
|
||||
}
|
||||
|
||||
$oModelSelf->$sField = $aJson;
|
||||
$oModelSelf->save();
|
||||
|
||||
$aParam = [];
|
||||
$aParam["aOption"][1] = "id";
|
||||
$aParam["aArg"][1] = $iId;
|
||||
|
||||
return $this->find($aParam);
|
||||
}
|
||||
|
||||
public function arrUnset($aParam)
|
||||
{
|
||||
$aParam["sCmd"] = "unset";
|
||||
|
||||
@ -29,6 +29,17 @@ class Test extends Base {
|
||||
return $this->oDog->$sName($aArg[0]);
|
||||
}
|
||||
|
||||
public function tmail()
|
||||
{
|
||||
$resend = Resend::client('re_5wGp8mP6_654KJcRifD52rfzkoEoTjR8u');
|
||||
|
||||
$resend->emails->send([
|
||||
'from' => 'onboarding@resend.dev',
|
||||
'to' => 'mukaitao@proton.me',
|
||||
'subject' => 'Hello World',
|
||||
'html' => '<p>Congrats on sending your <strong>first email</strong>!</p>'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function t1()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user