Skip to content

Commit fa668a9

Browse files
author
Aaron Schlesinger
committed
fix(boot.go,pkg/sshd/config.go): make the sleep duration configurable
1 parent ccca9b5 commit fa668a9

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

boot.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"log"
55
"os"
66
"runtime"
7-
"time"
87

98
cookoolog "github.com/Masterminds/cookoo/log"
109
"github.com/codegangsta/cli"
@@ -23,7 +22,6 @@ const (
2322
serverConfAppName = "deis-builder-server"
2423
gitReceiveConfAppName = "deis-builder-git-receive"
2524
gitHomeDir = "/home/git"
26-
cleanerPollDuration = 1 * time.Second // TODO: make this configurable
2725
)
2826

2927
func init() {
@@ -72,7 +70,7 @@ func main() {
7270
log.Printf("Starting deleted app cleaner")
7371
cleanerErrCh := make(chan error)
7472
go func() {
75-
if err := cleaner.Run(gitHomeDir, kubeClient.Namespaces(), cleanerPollDuration); err != nil {
73+
if err := cleaner.Run(gitHomeDir, kubeClient.Namespaces(), cnf.CleanerPollSleepDuration); err != nil {
7674
cleanerErrCh <- err
7775
}
7876
}()

pkg/sshd/config.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package sshd
22

3+
import (
4+
"time"
5+
)
6+
37
// Config represents the required SSH server configuration
48
type Config struct {
5-
SSHHostIP string `envconfig:"SSH_HOST_IP" default:"0.0.0.0" required:"true"`
6-
SSHHostPort int `envconfig:"SSH_HOST_PORT" default:"2223" required:"true"`
7-
HealthSrvPort int `envconfig:"HEALTH_SERVER_PORT" default:"8092"`
8-
HealthSrvTestStorageRegion string `envconfig:"HELATH_SERVER_TEST_STORAGE_REGION" default:"us-east-1"`
9+
SSHHostIP string `envconfig:"SSH_HOST_IP" default:"0.0.0.0" required:"true"`
10+
SSHHostPort int `envconfig:"SSH_HOST_PORT" default:"2223" required:"true"`
11+
HealthSrvPort int `envconfig:"HEALTH_SERVER_PORT" default:"8092"`
12+
HealthSrvTestStorageRegion string `envconfig:"HEALTH_SERVER_TEST_STORAGE_REGION" default:"us-east-1"`
13+
CleanerPollSleepDuration time.Duration `envconfig:"CLEANER_POLL_SLEEP_DURATION" default:"1"`
914
}

0 commit comments

Comments
 (0)