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
0f3776a9
authored
Jan 10, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
init
parent
ee06b3f0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
13 deletions
master/ApiServer.go
master/JobMgr.go
master/LogMgr.go
master/WorkerMgr.go
master/main/master.go
master/main/master.json
master/ApiServer.go
View file @
0f3776a9
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"net"
"net"
"time"
"time"
"strconv"
"strconv"
"g
ithub.com/owenliang/
crontab/common"
"g
o-
crontab/common"
"encoding/json"
"encoding/json"
)
)
...
...
master/JobMgr.go
View file @
0f3776a9
...
@@ -3,7 +3,7 @@ package master
...
@@ -3,7 +3,7 @@ package master
import
(
import
(
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/clientv3"
"time"
"time"
"g
ithub.com/owenliang/
crontab/common"
"g
o-
crontab/common"
"encoding/json"
"encoding/json"
"context"
"context"
"github.com/coreos/etcd/mvcc/mvccpb"
"github.com/coreos/etcd/mvcc/mvccpb"
...
...
master/LogMgr.go
View file @
0f3776a9
package
master
package
master
import
(
import
(
"g
ithub.com/mongodb/mongo-
go-driver/mongo"
"g
o.mongodb.org/mon
go-driver/mongo"
"context"
"context"
"github.com/mongodb/mongo-go-driver/mongo/clientopt"
"go.mongodb.org/mongo-driver/mongo/options"
"time"
"go-crontab/common"
"github.com/owenliang/crontab/common"
"github.com/mongodb/mongo-go-driver/mongo/findopt"
)
)
// mongodb日志管理
// mongodb日志管理
...
@@ -25,10 +23,10 @@ func InitLogMgr() (err error) {
...
@@ -25,10 +23,10 @@ func InitLogMgr() (err error) {
)
)
// 建立mongodb连接
// 建立mongodb连接
// 建立mongodb连接
clientOptions
:=
options
.
Client
()
.
ApplyURI
(
"mongodb://ichunt:huntmon6699@192.168.1.237:27017/ichunt?authMechanism=SCRAM-SHA-1"
)
if
client
,
err
=
mongo
.
Connect
(
if
client
,
err
=
mongo
.
Connect
(
context
.
TODO
(),
context
.
TODO
(),
clientOptions
);
err
!=
nil
{
G_config
.
MongodbUri
,
clientopt
.
ConnectTimeout
(
time
.
Duration
(
G_config
.
MongodbConnectTimeout
)
*
time
.
Millisecond
));
err
!=
nil
{
return
return
}
}
...
...
master/WorkerMgr.go
View file @
0f3776a9
...
@@ -4,7 +4,7 @@ import (
...
@@ -4,7 +4,7 @@ import (
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/clientv3"
"time"
"time"
"context"
"context"
"g
ithub.com/owenliang/
crontab/common"
"g
o-
crontab/common"
"github.com/coreos/etcd/mvcc/mvccpb"
"github.com/coreos/etcd/mvcc/mvccpb"
)
)
...
...
master/main/master.go
View file @
0f3776a9
...
@@ -2,7 +2,7 @@ package main
...
@@ -2,7 +2,7 @@ package main
import
(
import
(
"runtime"
"runtime"
"g
ithub.com/owenliang/
crontab/master"
"g
o-
crontab/master"
"fmt"
"fmt"
"flag"
"flag"
"time"
"time"
...
...
master/main/master.json
View file @
0f3776a9
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"apiWriteTimeout"
:
5000
,
"apiWriteTimeout"
:
5000
,
"etcd的集群列表"
:
"配置多个, 避免单点故障"
,
"etcd的集群列表"
:
"配置多个, 避免单点故障"
,
"etcdEndpoints"
:
[
"
36.111.184.221
:2379"
],
"etcdEndpoints"
:
[
"
192.168.2.232
:2379"
],
"etcd的连接超时"
:
"单位毫秒"
,
"etcd的连接超时"
:
"单位毫秒"
,
"etcdDialTimeout"
:
5000
,
"etcdDialTimeout"
:
5000
,
...
...
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