Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
go-crontab
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
ac40368e
authored
Feb 25, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
uo
parent
59ea36eb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
main.go
main.go
View file @
ac40368e
...
@@ -16,7 +16,6 @@ func main(){
...
@@ -16,7 +16,6 @@ func main(){
getResp
*
clientv3
.
GetResponse
getResp
*
clientv3
.
GetResponse
)
)
//配置
//配置
config
=
clientv3
.
Config
{
config
=
clientv3
.
Config
{
Endpoints
:
[]
string
{
"192.168.2.232:2379"
},
Endpoints
:
[]
string
{
"192.168.2.232:2379"
},
...
@@ -41,13 +40,14 @@ func main(){
...
@@ -41,13 +40,14 @@ func main(){
//新增定时任务
//新增定时任务
//
putResp, err := kv.Put(context.TODO(),"/cron/jobs/192.168.2.246/job1","{\"name\":\"job1\",\"command\":\"D:/phpstudy/PHPTutorial/php/php-5.6.27-nts/php E:/WWW/a.php\",\"cronExpr\":\"*/7 * * * * * *\"}",clientv3.WithPrevKV())
putResp
,
err
:=
kv
.
Put
(
context
.
TODO
(),
"/cron/jobs/192.168.2.246/job1"
,
"{
\"
name
\"
:
\"
job1
\"
,
\"
command
\"
:
\"
D:/phpstudy/PHPTutorial/php/php-5.6.27-nts/php E:/WWW/a.php
\"
,
\"
cronExpr
\"
:
\"
*/7 * * * * * *
\"
}"
,
clientv3
.
WithPrevKV
())
//putResp, err := kv.Put(context.TODO(),"/cron/jobs/192.168.2.246/job2","{\"name\":\"job2\",\"command\":\" echo hello world\",\"cronExpr\":\"*/5 * * * * * *\"}",clientv3.WithPrevKV())
//putResp, err := kv.Put(context.TODO(),"/cron/jobs/192.168.2.246/job2","{\"name\":\"job2\",\"command\":\" echo hello world\",\"cronExpr\":\"*/5 * * * * * *\"}",clientv3.WithPrevKV())
//putResp, err := kv.Put(context.TODO(),"/cron/jobs/192.168.2.246/job3","{\"name\":\"job3\",\"command\":\" echo hello boy\",\"cronExpr\":\"*/10 * * * * * *\"}",clientv3.WithPrevKV())
//putResp, err := kv.Put(context.TODO(),"/cron/jobs/192.168.2.246/job3","{\"name\":\"job3\",\"command\":\" echo hello boy\",\"cronExpr\":\"*/10 * * * * * *\"}",clientv3.WithPrevKV())
fmt
.
Println
(
putResp
)
fmt
.
Println
(
err
)
//新增一次性任务
//新增一次性任务
//putResp, err := kv.Put(context.TODO(),"/cron/oncejobs/192.168.2.2
46
/job10","{\"name\":\"job10\",\"command\":\" D:/phpstudy/PHPTutorial/php/php-5.6.27-nts/php E:/WWW/b.php \"}",clientv3.WithPrevKV())
//putResp, err := kv.Put(context.TODO(),"/cron/oncejobs/192.168.2.2
32
/job10","{\"name\":\"job10\",\"command\":\" D:/phpstudy/PHPTutorial/php/php-5.6.27-nts/php E:/WWW/b.php \"}",clientv3.WithPrevKV())
//强杀任务
//强杀任务
...
...
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