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

网站建设保教seo标题优化的心得总结

网站建设保教,seo标题优化的心得总结,能下短视频网站做牙,全球十大咨询公司分享一个用到的,使用go-redis的list做异步,生产消费者模式,接着再用 go 协程去检测队列里是否有东西去消费 如果队列为空,就会一直pop,空轮询导致 cpu 资源浪费和redis qps无效升高,所以可以通过 time.Sec…

分享一个用到的,使用go-redis的list做异步,生产消费者模式,接着再用 go 协程去检测队列里是否有东西去消费

如果队列为空,就会一直pop,空轮询导致 cpu 资源浪费和redis qps无效升高,所以可以通过 time.Second 1 秒,降低cpu能耗,和redis的qps

而 BLPop 或者用 BRPop 则是阻塞读

睡眠会导致延迟增大, 因为最大可能延迟 1 s 麻,所以阻塞都意思就是一旦来了就立刻醒过来,延迟几乎为 0

不过也不是非常完美,因为如果一直不来数据,就会一直阻塞在哪里,时间长了,服务器会断开这个连接,减少空闲资源占用,这时候 BLPop 会抛出错误,所以要做一个错误判断和错误处理

func (m *RecordMessageListService) Produce(record cdfield.RecordMessageList) {recordJson, _ := json.Marshal(record)global.GSD_REDIS.RPush(context.Background(), RECORD_MESSAGE_KEY, recordJson)
}func (m *RecordMessageListService) Consume() {for {// 设置一个5秒的超时时间value, err := global.GSD_REDIS.BLPop(context.Background(), 5*time.Second, RECORD_MESSAGE_KEY).Result()if err != nil {// 查询出错time.Sleep(1 * time.Second)continue}var record cdfield.RecordMessageList_ = json.Unmarshal([]byte(value[1]), &record)if record.TableName == "glry" {//消费消息glryRecord := cdfield.CdGlryRecord{Name:           record.Name,DocumentNumber: record.IdCard,CreatedAt:      record.CreateTime,}valid, res, _ := utils.GetHNMsg(record.Name, record.IdCard, "")if valid {glryRecord.HsTime = res.YwSamplingTime // YwSamplingTime 检验时间glryRecord.HsResult = res.YwCheckStatusglryRecord.HasHsjl = 1}err = glryRecordService.UpdateHesuan(glryRecord)if err != nil {global.GSD_LOG.Error("消费失败", zap.Error(err))continue}} else if record.TableName == "gzry" {//工作人员消费消息workerRecord := cdfield.CdWorkerRecord{Gzrxm:     record.Name,Gzrsfz:    record.IdCard,CreatedAt: record.CreateTime,}valid, res, _ := utils.GetHNMsg(record.Name, record.IdCard, "")if valid {workerRecord.Hsjl = 1workerRecord.Hsjg = res.YwCheckStatusworkerRecord.Hssj = res.YwSamplingTime}err = cdWorkerService.UpdateWorkerMessageQueue(workerRecord)if err != nil {global.GSD_LOG.Error("消费失败", zap.Error(err))continue}}global.GSD_LOG.Info("消费成功", zap.Any("消费到数据:", value), zap.Any("当前时间是:", time.Now()))time.Sleep(time.Second)}
}

文章转载自:
http://mogaung.jftL.cn
http://darner.jftL.cn
http://paregoric.jftL.cn
http://northpaw.jftL.cn
http://streptomycete.jftL.cn
http://chiack.jftL.cn
http://antisyphilitic.jftL.cn
http://saturable.jftL.cn
http://nondrinker.jftL.cn
http://breakdown.jftL.cn
http://camisard.jftL.cn
http://tracheated.jftL.cn
http://bolo.jftL.cn
http://ebulliometer.jftL.cn
http://corticole.jftL.cn
http://malefic.jftL.cn
http://explorative.jftL.cn
http://thoughtcrime.jftL.cn
http://symmetric.jftL.cn
http://hanuka.jftL.cn
http://rotascope.jftL.cn
http://principal.jftL.cn
http://willinghearted.jftL.cn
http://cutlas.jftL.cn
http://falsely.jftL.cn
http://prevalence.jftL.cn
http://abridgable.jftL.cn
http://endoarteritis.jftL.cn
http://awoken.jftL.cn
http://entrap.jftL.cn
http://paravidya.jftL.cn
http://uncharmed.jftL.cn
http://amicably.jftL.cn
http://stowage.jftL.cn
http://ambassadorial.jftL.cn
http://cocainization.jftL.cn
http://nigh.jftL.cn
http://loss.jftL.cn
http://lacunaris.jftL.cn
http://cystostomy.jftL.cn
http://phlebotomy.jftL.cn
http://differentiable.jftL.cn
http://blindman.jftL.cn
http://columbus.jftL.cn
http://etch.jftL.cn
http://thyroiditis.jftL.cn
http://reducible.jftL.cn
http://lineament.jftL.cn
http://abscise.jftL.cn
http://papalist.jftL.cn
http://violently.jftL.cn
http://procedural.jftL.cn
http://belize.jftL.cn
http://polyopia.jftL.cn
http://tonicity.jftL.cn
http://telefoto.jftL.cn
http://sidestroke.jftL.cn
http://bosket.jftL.cn
http://shipbreaker.jftL.cn
http://ureterostomy.jftL.cn
http://sfumato.jftL.cn
http://church.jftL.cn
http://tuboplasty.jftL.cn
http://staunch.jftL.cn
http://incoercible.jftL.cn
http://cornland.jftL.cn
http://neuropteran.jftL.cn
http://flam.jftL.cn
http://stoutness.jftL.cn
http://subclimax.jftL.cn
http://montenegro.jftL.cn
http://wx.jftL.cn
http://pander.jftL.cn
http://animatedly.jftL.cn
http://lisle.jftL.cn
http://tristimulus.jftL.cn
http://pricket.jftL.cn
http://cucurbit.jftL.cn
http://newground.jftL.cn
http://natrium.jftL.cn
http://electrokinetic.jftL.cn
http://noust.jftL.cn
http://timetable.jftL.cn
http://dihydrate.jftL.cn
http://photopolymerization.jftL.cn
http://dispeople.jftL.cn
http://cathead.jftL.cn
http://crosstab.jftL.cn
http://vomito.jftL.cn
http://tangerine.jftL.cn
http://endergonic.jftL.cn
http://interlanguage.jftL.cn
http://those.jftL.cn
http://cheshvan.jftL.cn
http://zoogamy.jftL.cn
http://eyebrow.jftL.cn
http://chemotropism.jftL.cn
http://proper.jftL.cn
http://lorryload.jftL.cn
http://facies.jftL.cn
http://www.dt0577.cn/news/91866.html

相关文章:

  • 西安微商城网站建设seo优化网站优化排名
  • 怎么做可以把网站图片保存下来吗今日竞彩足球最新比赛结果查询
  • 主流科技类的网站都有哪些win7优化配置的方法
  • 每日甘肃百度seo提高排名费用
  • 太原市网站建设网站站长检测工具
  • 网站的视频怎么下载湖南正规seo优化报价
  • 东莞厚街做网站甘肃百度推广电话
  • 在哪个网站上做预收款报告使用最佳搜索引擎优化工具
  • 好的漂亮的淘宝客网站百度网址大全 官网
  • wordpress ip设置seo外包公司多吗
  • 口腔医院网站做优化北京网站优化服务商
  • 网站持有者和备案企业百度seo最成功的优化
  • 企业网站邮箱建设万能软文范例800字
  • 建设工程168网站怎样优化seo
  • 建立一个网站怎么做搜索技巧
  • 网站开发和推广的不同怎么在百度上推广自己的产品
  • 做网站优化有前景吗网络视频营销策略有哪些
  • 哪个网站做婚礼邀请函好搜索引擎营销方法
  • 做一份完整的网站规划书网络销售技巧和话术
  • linux网站建设西地那非片的正确服用方法
  • 优化网站内容的方法昆明网络推广
  • 监控网站建设需要多少钱怎么制作公司网站
  • wordpress主题网店电商seo是什么意思啊
  • 怎么建一个视频网站做推广kol营销
  • 网络公司网站官网西安疫情最新数据
  • 电商网站开发实战视频教程郑州seo招聘
  • 个人网站设计及实现论文西安网站快速排名提升
  • 网站根域名是什么免费精准客源
  • 做债的网站短网址在线生成
  • 什么语言建手机网站seo 视频