Skip to content

Commit

Permalink
fix: remove conflicts (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
link-duan committed Sep 7, 2020
1 parent 3e5bd48 commit 98de3b6
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pkg/job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"time"

"github.com/coreos/etcd/clientv3/concurrency"
"github.com/douyu/juno-agent/pkg/job/etcd"
"github.com/douyu/jupiter/pkg/client/etcdv3"
"github.com/douyu/jupiter/pkg/xlog"
"go.uber.org/zap"
Expand Down Expand Up @@ -60,12 +61,9 @@ type Job struct {

// 用于访问etcd
*worker `json:"-"`
<<<<<<< feature/cronjob

mutex *etcdv3.Mutex
locked bool
=======
>>>>>>> master
}

// NewEtcdTimeoutContext return a new etcdTimeoutContext
Expand Down Expand Up @@ -210,7 +208,6 @@ func (j *Job) ValidRules() error {
return nil
}

<<<<<<< feature/cronjob
func (j *Job) Lock() error {
var err error
j.mutex, err = j.Client.NewMutex(LockKeyPrefix+j.ID, concurrency.WithTTL(10))
Expand All @@ -237,8 +234,6 @@ func (j *Job) Unlock() {
}
}

=======
>>>>>>> master
type Timer struct {
ID string `json:"id"`
Cron string `json:"timer"`
Expand Down Expand Up @@ -299,9 +294,6 @@ func (c *Cmd) GetID() string {
}

func (c *Cmd) Run() error {
<<<<<<< feature/cronjob
=======

if c.Job.JobType == TypeAlone {
mutex, err := etcd.NewMutex(c.Client.Client, LockKeyPrefix+c.Job.ID, concurrency.WithTTL(5))
if err != nil {
Expand All @@ -316,7 +308,6 @@ func (c *Cmd) Run() error {
defer mutex.Unlock()
}

>>>>>>> master
if c.Job.RetryCount <= 0 {
err := c.Job.Run()
if err != nil {
Expand Down

0 comments on commit 98de3b6

Please sign in to comment.