Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lzzzzl
/
golang_seo_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6ef90ca7
authored
Dec 10, 2020
by
lzzzzl
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
rabbit消费测试
parent
b6c1d3db
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
cmd/main.go
dal/function/fuction.go
cmd/main.go
View file @
6ef90ca7
...
...
@@ -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
)
}
dal/function/fuction.go
View file @
6ef90ca7
...
...
@@ -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
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment