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
5ae80e46
authored
Dec 07, 2020
by
lzzzzl
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
新增消息提醒
parent
ac12d0c9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
27 deletions
cmd/main.go
cmd/main.go
View file @
5ae80e46
...
...
@@ -17,6 +17,8 @@ import (
var
ConfigDir
string
var
LogDir
string
var
mobile
[]
string
var
isAtAll
bool
type
RecvPro
struct
{}
...
...
@@ -119,35 +121,14 @@ func main() {
fmt
.
Println
(
mainRemain
)
fmt
.
Println
(
mipRemain
)
var
msgRemain
=
fmt
.
Sprintf
(
"联营剩余条数:%d, 主站剩余条数:%d, MIP站剩余条数: %d"
,
lyRemain
,
mainRemain
,
mipRemain
)
logger
.
Info
(
msgRemain
)
ding
.
Send
(
util
.
Configs
.
Ding_msg
.
Webhook
,
"SEO推送"
,
msgRemain
,
mobile
,
isAtAll
)
ding
.
Send
(
util
.
Configs
.
Ding_msg
.
Webhook
,
"SEO推送"
,
"任务启动"
,
mobile
,
isAtAll
)
ly
.
RunLyTask
(
lyRemain
,
ConfigDir
)
lxmain
.
RunMainTask
(
mainRemain
,
ConfigDir
)
mip
.
RunMipTask
(
mipRemain
,
ConfigDir
)
//// 根据cron表达式进行时间调度,cron可以精确到秒
////crontab := cron.New() 默认从分开始进行时间调度
//crontab := cron.New(cron.WithSeconds()) //精确到秒
////定义定时器调用的任务函数
//task := func() {
// logger.Info("定时任务启动,每天凌晨1点运行")
// ly.RunLyTask(lyRemain, ConfigDir)
// lxmain.RunMainTask(mainRemain, ConfigDir)
// mip.RunMipTask(mipRemain, ConfigDir)
// //
// defer db.SeoDB.Close()
// defer db.SpuDB.Close()
// defer db.GoodsDB.Close()
// defer db.SkuDB.Close()
// defer db.LxDB.Close()
// ////fmt.Println("******** ******* *******")
// //fmt.Println("Time now:", time.Now().Format("2006-01-02 15:04:05"))
//}
////定时任务
//spec := "0 0 1 * * ?" //cron表达式,每天凌晨1点运行
////spec := "2 * * * * *" //cron表达式,表示每分钟的第2s执行一次
//// 添加定时任务,
//_, _ = crontab.AddFunc(spec, task)
//// 启动定时器
//crontab.Start()
////阻塞主线程停止
//select {}
}
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