]> git.r.bdr.sh - rbdr/mobius/blobdiff - cmd/mobius-hotline-server/main.go
Seed the random number generator
[rbdr/mobius] / cmd / mobius-hotline-server / main.go
index cf69ea8ae1f5f2e35b431c5c78a745b38cad4e44..285f67b534eb42fcc0fb91a68237db9814e41d69 100644 (file)
@@ -7,7 +7,9 @@ import (
        "github.com/jhalter/mobius/hotline"
        "go.uber.org/zap"
        "go.uber.org/zap/zapcore"
        "github.com/jhalter/mobius/hotline"
        "go.uber.org/zap"
        "go.uber.org/zap/zapcore"
+       "math/rand"
        "os"
        "os"
+       "time"
 )
 
 const (
 )
 
 const (
@@ -16,6 +18,8 @@ const (
 )
 
 func main() {
 )
 
 func main() {
+       rand.Seed(time.Now().UnixNano())
+
        ctx, cancelRoot := context.WithCancel(context.Background())
 
        basePort := flag.Int("bind", defaultPort, "Bind address and port")
        ctx, cancelRoot := context.WithCancel(context.Background())
 
        basePort := flag.Int("bind", defaultPort, "Bind address and port")
@@ -44,7 +48,7 @@ func main() {
                logger.Fatalw("Configuration directory not found", "path", configDir)
        }
 
                logger.Fatalw("Configuration directory not found", "path", configDir)
        }
 
-       hotline.FS = hotline.OSFileStore{}
+       hotline.FS = &hotline.OSFileStore{}
 
        srv, err := hotline.NewServer(*configDir, "", *basePort, logger)
        if err != nil {
 
        srv, err := hotline.NewServer(*configDir, "", *basePort, logger)
        if err != nil {