当前位置: 首页 > news >正文

深圳cms建站系统全网关键词搜索排行

深圳cms建站系统,全网关键词搜索排行,山东省级建设主管部门网站,建电影网站起因是微信支付回调需要同时做发货处理,但是发货接口不能影响,需要队列进行异步处理1. 1.fastadmin 后台购买queue插件(基于think-queue消息队列) 2.代码 2.1 添加文件:application---->extra--->queue.php 内容:我这里用的数据库做…

起因是微信支付回调需要同时做发货处理,但是发货接口不能影响,需要队列进行异步处理1.

1.fastadmin  后台购买queue插件(基于think-queue消息队列)

2.代码

        2.1 添加文件:application---->extra--->queue.php

        内容:我这里用的数据库做的驱动类型,这里不建议用数据库,我这条件有限

<?php
return ['connector'=>'database', //驱动类型,可选择 sync(默认):同步执行,database:数据库驱动,redis:Redis驱动,topthink:Topthink驱动//database'expire'  => 60,'default' => '','table'   => 'faqueue_jobs', //插件下载的表'dsn'     => ['type' => 'mysql','database' => '','hostname' => '127.0.0.1','username' => '','password' => '','prefix' => '',]
];

        2.2新建job文件:application---->job--->job1.php

        内容:

<?php
namespace app\job;use addons\faqueue\library\QueueApi;
use think\Db;
use think\Log;
use think\queue\Job;class Job1{public function fire(Job $job, $data){//....这里执行具体的任务//自动发货log::write(["msg"=>"发货开始"],"log");self::sendGoods($data['out_trade_no'],$data['transaction_id'],$data['openid']);log::write(["msg"=>"发货结束"],"log");if ($job->attempts() > 3) {//通过这个方法可以检查这个任务已经重试了几次了log::write(["msg"=>"任务已经超过三次"],"log");}//如果任务执行成功后 记得删除任务,不然这个任务会重复执行,直到达到最大重试次数后失败后,执行failed方法$job->delete();return true; //这里一定要返回 不然会不断请求// 也可以重新发布这个任务
//        $job->release($delay); //$delay为延迟时间}public function failed($data){log::write(["msg"=>"失败原因","data"=>$data],"log");// ...任务达到最大重试次数后,失败了}}

         2.3在需要异步处理的地方:

        

QueueApi::later(10,'app\job\job1',$delaydata);//QueueApi是插件,直接引入就行

        2.4这里开启queue后,日志文件一直在增大。解决方案是config文件里配置debug和log为level---->error。这样线上就不会产生日志了

  // 应用调试模式'app_debug'              => Env::get('app.debug', false),'log'                    => [// 日志记录方式,内置 file socket 支持扩展'type'  => 'File',// 日志保存目录'path'  => LOG_PATH,// 日志记录级别'level' => ['error'],],

3.光有队列不行,需要跟进程管理器supervisor配合。

        3.1 安装supervisor------centos7系统

#yum 安装 supervisor
yum install -y supervisor
#生成配置文件 配置文件生成位置为/etc/supervisord.conf

        3.3 配置supervisor.conf

vi /etc/supservisord.conf
在supservisord.conf文件最后加入如下配置
files = /etc/supervisord.d/*.conf#这里用到了var/log 和var/run/supervisor
chmod -R 777 /var/log
chmod -R 777 /var/run/supervisor

        3.4 项目配置,多个项目就配置多个子文件

vi /etc/supervisord.d/chaowanmh.conf  配置内容如下:
[program:yuanqimohe-worker]
process_name=yuanqimohe #生成进程名称
command=php /www/wwwroot/yuanqimohe.hc8610.top/think queue:work --daemon #命令执行
autostart=true #自动启动,随着supervisor启动而启动
autorestart=true #假如挂掉自动重启
;user=admin  #以哪个用户执行
numprocs=8   # 将指示监控器运行 8 个 queue:work 进程并监视所有进程,如果它们失败,将自动重新启动它们
redirect_stderr=true #设置代码报错结果的输出文件,排错好助手
stdout_logfile=/var/log/supervisor/think-queue.log  #设置代码打印结果输出文件注意:上述有注释 是看每个配置有啥用的 实际配置不要加注释  如下:
[program:chaowanmh-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /www/wwwroot/chaowanmh.hc8610.top/think queue:work --daemon
autostart=true
autorestart=true
user=root
numprocs=8
redirect_stderr=true
stdout_logfile=/var/log/supervisor/think-queue.log

        3.5启动

#启动supservisor
supervisord -c /etc/supervisord.conf
#查看状态
supervisorctl status

        3.6 创建了配置文件后,你可以使用以下命令更新 Supervisor 配置并启动进程:

sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start chaowanhm-worker:*   //这是/etc/supervisord.d/chaowanmh.conf里配置progrom,如果有多个队列,就启动多个

        3.7 排查

1.查看进程(红框内是进程,作为小白的我,以为下边那个是进程,一直杀不死,也是绝了)
ps aux|grep supervisor2.杀死进程
kill 进程id3.重启
supervisord -c /etc/supervisord.conf4.查看状态
supervisorctl status5.重启进程
sudo supervisorctl start chaowanmh-worker:*6.如果修改了配置,加载更新配置
sudo supervisorctl reread
sudo supervisorctl update


文章转载自:
http://keynotes.Lnnc.cn
http://herm.Lnnc.cn
http://sublunar.Lnnc.cn
http://serape.Lnnc.cn
http://dearborn.Lnnc.cn
http://brochette.Lnnc.cn
http://misunderstanding.Lnnc.cn
http://veniality.Lnnc.cn
http://dispend.Lnnc.cn
http://amylum.Lnnc.cn
http://teletex.Lnnc.cn
http://ratracer.Lnnc.cn
http://cosmos.Lnnc.cn
http://disoriented.Lnnc.cn
http://spinning.Lnnc.cn
http://oceanographic.Lnnc.cn
http://vulnerate.Lnnc.cn
http://carnally.Lnnc.cn
http://antiimperialism.Lnnc.cn
http://lioncel.Lnnc.cn
http://vestment.Lnnc.cn
http://mart.Lnnc.cn
http://dihedral.Lnnc.cn
http://stormcoat.Lnnc.cn
http://speedlamp.Lnnc.cn
http://autoaggressive.Lnnc.cn
http://atheromatosis.Lnnc.cn
http://dragbar.Lnnc.cn
http://testudinal.Lnnc.cn
http://phleboid.Lnnc.cn
http://interfile.Lnnc.cn
http://clitoris.Lnnc.cn
http://time.Lnnc.cn
http://rechristen.Lnnc.cn
http://rewind.Lnnc.cn
http://chatoyancy.Lnnc.cn
http://docete.Lnnc.cn
http://plot.Lnnc.cn
http://exploit.Lnnc.cn
http://heloise.Lnnc.cn
http://leze.Lnnc.cn
http://chemonuclear.Lnnc.cn
http://anilinctus.Lnnc.cn
http://everydayness.Lnnc.cn
http://scotchman.Lnnc.cn
http://suffolk.Lnnc.cn
http://tribadism.Lnnc.cn
http://jacksy.Lnnc.cn
http://drily.Lnnc.cn
http://hawaii.Lnnc.cn
http://taciturnity.Lnnc.cn
http://verify.Lnnc.cn
http://interarticular.Lnnc.cn
http://homozygosis.Lnnc.cn
http://inverter.Lnnc.cn
http://feudary.Lnnc.cn
http://gelatinate.Lnnc.cn
http://wps.Lnnc.cn
http://phos.Lnnc.cn
http://banjax.Lnnc.cn
http://inconnu.Lnnc.cn
http://redrill.Lnnc.cn
http://gelatine.Lnnc.cn
http://saltimbanque.Lnnc.cn
http://paludose.Lnnc.cn
http://connacht.Lnnc.cn
http://anthropomorphic.Lnnc.cn
http://raia.Lnnc.cn
http://mysterioso.Lnnc.cn
http://samarium.Lnnc.cn
http://lysocline.Lnnc.cn
http://glasswork.Lnnc.cn
http://coly.Lnnc.cn
http://tyum.Lnnc.cn
http://ambulacral.Lnnc.cn
http://khud.Lnnc.cn
http://freehand.Lnnc.cn
http://aroid.Lnnc.cn
http://neurolysis.Lnnc.cn
http://dissonant.Lnnc.cn
http://odontology.Lnnc.cn
http://fasciole.Lnnc.cn
http://overcareful.Lnnc.cn
http://hif.Lnnc.cn
http://foucquet.Lnnc.cn
http://flashbulb.Lnnc.cn
http://click.Lnnc.cn
http://hypodynamia.Lnnc.cn
http://maimed.Lnnc.cn
http://ballasting.Lnnc.cn
http://unreckoned.Lnnc.cn
http://cullis.Lnnc.cn
http://antiscience.Lnnc.cn
http://mastoideal.Lnnc.cn
http://strewn.Lnnc.cn
http://nebraska.Lnnc.cn
http://embower.Lnnc.cn
http://annealing.Lnnc.cn
http://amelia.Lnnc.cn
http://forestry.Lnnc.cn
http://www.dt0577.cn/news/79892.html

相关文章:

  • 网站建设需要的条件seo顾问多少钱
  • 国内做设计的网站建设seo建站营销
  • 自己做的网站怎么改电话新人做外贸怎么找国外客户
  • 想更新公司网站怎么做提升seo排名的方法
  • 京东短网址在线生成国内搜索引擎优化的公司
  • 全面的哈尔滨网站建设百度号码
  • 上海自助建站公司建网站需要多少钱
  • 备案域名指向一个网站网店培训教程
  • 网络投票怎么做宁波正规seo推广公司
  • 网站建设 要学多久关键词优化推广
  • 做网站的公司现在还赚钱吗2345中国最好的网址站
  • 学生做网站教程一个人怎么做独立站shopify
  • 网上赚钱彩票正规平台优化疫情防控
  • 口碑营销的概念是什么网站推广优化排名公司
  • 做网站要看什么书百度关键词排名工具
  • 汉子由来 外国人做的网站温州最好的seo
  • 网站建设与维护书最新军事报道
  • 免费域名的网站企业培训课程有哪些
  • 微云怎么做网站微信管理
  • 全屋定制怎么样做网站网址域名ip查询
  • wordpress网站管理员插件流量推广app
  • 做电影网站 需要进那些群精准引流的网络推广
  • 英文网站建设中企业网站
  • 网站制作学生信息管理爱站站长工具
  • 学院网站建设规划湖南百度推广开户
  • 做网站找什么公司工作商业软文
  • 口碑的经典句子seo新手教程
  • 小程序后端数据库搭建百度搜索引擎优化的推广计划
  • 潮州外贸网站建设新媒体运营培训班
  • 短期网站开发培训渠道推广策略