From fc9a192d8797bbc64c400375ac736dbee52d22c8 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 23 Sep 2019 21:32:15 -0400 Subject: [PATCH] worker: update SSH port selection logic --- worker/go.mod | 2 ++ worker/tasks.go | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/worker/go.mod b/worker/go.mod index 1878e4b..4df3628 100644 --- a/worker/go.mod +++ b/worker/go.mod @@ -21,3 +21,5 @@ require ( github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e ) + +go 1.13 diff --git a/worker/tasks.go b/worker/tasks.go index 08a5251..3f320a3 100644 --- a/worker/tasks.go +++ b/worker/tasks.go @@ -32,11 +32,9 @@ var ( func (ctx *JobContext) Boot(r *redis.Client) func() { port, err := r.Incr("builds.sr.ht.ssh-port").Result() if err == nil && port < 22000 { - port = 22000 - err = r.Set("builds.sr.ht.ssh-port", port, 0).Err() + err = r.Set("builds.sr.ht.ssh-port", 22100, 0).Err() } else if err == nil && port >= 23000 { - port = 22000 - err = r.Set("builds.sr.ht.ssh-port", port, 0).Err() + err = r.Set("builds.sr.ht.ssh-port", 22000, 0).Err() } if err != nil { panic(errors.Wrap(err, "assign port")) -- 2.38.5