Fix up host ports and env variables
This commit is contained in:
parent
7c830f58be
commit
98249948a1
8 changed files with 38 additions and 55 deletions
|
@ -17,8 +17,6 @@ import (
|
|||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
var accountantAddress = os.Getenv("ACCOUNTANT_ADDRESS")
|
||||
|
||||
const (
|
||||
// PersistentData will allow the server to load and save it's state
|
||||
PersistentData = iota
|
||||
|
@ -106,8 +104,9 @@ func (s *Server) Initialise(fillWorld bool) (err error) {
|
|||
s.sync.Add(1)
|
||||
|
||||
// Connect to the accountant
|
||||
accountantAddress := os.Getenv("ROVE_ACCOUNTANT_GRPC")
|
||||
if len(accountantAddress) == 0 {
|
||||
log.Fatal("must set ACCOUNTANT_ADDRESS")
|
||||
log.Fatal("must set $ROVE_ACCOUNTANT_GRPC")
|
||||
}
|
||||
log.Printf("Dialing accountant on %s\n", accountantAddress)
|
||||
s.clientConn, err = grpc.Dial(accountantAddress, grpc.WithInsecure())
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package internal
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -30,6 +31,7 @@ func TestNewServer_OptionPersistentData(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestServer_Run(t *testing.T) {
|
||||
os.Setenv("ROVE_ACCOUNTANT_GRPC", "n/a")
|
||||
server := NewServer()
|
||||
if server == nil {
|
||||
t.Error("Failed to create server")
|
||||
|
@ -45,6 +47,7 @@ func TestServer_Run(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestServer_RunPersistentData(t *testing.T) {
|
||||
os.Setenv("ROVE_ACCOUNTANT_GRPC", "n/a")
|
||||
server := NewServer(OptionPersistentData())
|
||||
if server == nil {
|
||||
t.Error("Failed to create server")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue