worker: set remoteAddress once on startup
This commit is contained in:
parent
ef7e8e0772
commit
16cd243300
1 changed files with 5 additions and 3 deletions
|
|
@ -67,9 +67,7 @@ func newConnection(remoteAddress string) (net.Conn, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
address := fmt.Sprintf("%s:%d", remoteAddress, RemoteWorkerPort)
|
||||
|
||||
return tls.Dial("tcp", address, conf)
|
||||
return tls.Dial("tcp", remoteAddress, conf)
|
||||
}
|
||||
|
||||
// plain non-encrypted connection
|
||||
|
|
@ -191,6 +189,10 @@ func main() {
|
|||
flag.StringVar(&remoteAddress, "remote", "", "Connect to a remote composer using the specified address")
|
||||
flag.Parse()
|
||||
|
||||
if remoteAddress != "" {
|
||||
remoteAddress = fmt.Sprintf("%s:%d", remoteAddress, RemoteWorkerPort)
|
||||
}
|
||||
|
||||
client := NewClient(remoteAddress)
|
||||
for {
|
||||
if err := handleJob(client); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue