Skip to content

Commit

Permalink
Merge pull request #69 from XDagger/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
swordlet authored Aug 22, 2023
2 parents c669b0e + ce39d01 commit 972a9b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
// }

var (
version = "2.0.6"
version = "2.0.7"

// cmd line options
configFile *string
Expand Down
17 changes: 16 additions & 1 deletion server/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,20 @@ func (p *Proxy) handleJob(job *Job) (err error) {

// broadcast a job to all workers
func (p *Proxy) broadcastJob() {
p.connMu.Lock()
defer p.connMu.Unlock()
if p.isClosed {
return
}

logger.Get().Debugln("Broadcasting new job to connected workers.")
//for _, w := range p.workers {
// go w.NewJob(p.NextJob())
//}
p.worker.NewJob(p.currentJob)
if p.worker != nil {
p.worker.NewJob(p.currentJob)
}

}

func (p *Proxy) handleNotification(notif []byte) {
Expand Down Expand Up @@ -471,6 +480,12 @@ func (p *Proxy) Close() {
// }

func (p *Proxy) handleSubmit(s *share) (err error) {
p.connMu.Lock()
defer p.connMu.Unlock()
if p.isClosed {
return
}

defer func() {
close(s.Response)
close(s.Error)
Expand Down

0 comments on commit 972a9b3

Please sign in to comment.