Commit 6ef90ca7 by lzzzzl

rabbit消费测试

parent b6c1d3db
Showing with 14 additions and 14 deletions
......@@ -3,11 +3,9 @@ package main
import (
"flag"
"fmt"
"github.com/ichunt2019/golang-rbmq-sl/utils/rabbitmq"
"github.com/ichunt2019/logger"
"github.com/tidwall/gjson"
"golang.seo.server/collect/lxmain"
"golang.seo.server/collect/ly"
"golang.seo.server/collect/mip"
"golang.seo.server/common/ding"
"golang.seo.server/dal/db"
"golang.seo.server/dal/function"
......@@ -104,14 +102,14 @@ func main() {
fmt.Println(errLx)
}
//t := &RecvPro{}
//go rabbitmq.Recv(rabbitmq.QueueExchange{
// util.Configs.Rabbitmq_seo_log.QueueName,
// util.Configs.Rabbitmq_seo_log.RoutingKey,
// util.Configs.Rabbitmq_seo_log.Exchange,
// util.Configs.Rabbitmq_seo_log.Type,
// util.Configs.Rabbitmq_seo_log.Dns,
//}, t, 3)
t := &RecvPro{}
go rabbitmq.Recv(rabbitmq.QueueExchange{
util.Configs.Rabbitmq_seo_log.QueueName,
util.Configs.Rabbitmq_seo_log.RoutingKey,
util.Configs.Rabbitmq_seo_log.Exchange,
util.Configs.Rabbitmq_seo_log.Type,
util.Configs.Rabbitmq_seo_log.Dns,
}, t, 3)
// 剩余条数
var lyRemain = function.RemainCount(util.Configs.Request_url.LyUrl, util.Configs.Request_url.LyData)
......@@ -125,9 +123,9 @@ func main() {
ding.Send(util.Configs.Ding_msg.Webhook, "SEO推送", "任务启动", mobile, isAtAll)
ly.RunLyTask(lyRemain, ConfigDir)
lxmain.RunMainTask(mainRemain, ConfigDir)
mip.RunMipTask(mipRemain, ConfigDir)
//ly.RunLyTask(lyRemain, ConfigDir)
//lxmain.RunMainTask(mainRemain, ConfigDir)
//mip.RunMipTask(mipRemain, ConfigDir)
time.Sleep(time.Duration(1) * time.Hour)
}
......@@ -147,7 +147,9 @@ func RegxUrl(url string) (res string) {
* @return
**/
func InsertLog(urls string, status string, urlType string) {
url := strings.Split(urls, "\n")
fmt.Println(len(url))
for i := 0; i < len(url); i++ {
_, err1 := db.SeoDB.Exec("INSERT INTO lie_url_log (url,status,url_type,create_time) VALUES (?,?,?,?)",
url[i], status, urlType, time.Now().Unix())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment