Пример #1
0
func main() {
	if len(os.Args) != 2 {
		printUsage()
		return
	}

	host := os.Args[1]
	hd := master.GetDbConnection()
	client.Debug("Starting server on", host)
	client.Debug("Press Ctrl-C to stop")
	master.StartServer(host, hd)

	waitForInterrupt()
}
Пример #2
0
func TestBasicStartWorker(t *testing.T) {
	runtime.GOMAXPROCS(2)

	fmt.Printf("Test: Worker starts up without issues\n")
	hd := master.GetTestDbConnection()
	fmt.Printf("got Db connection")
	master.ResetDb(hd)
	master.CreateTables(hd)

	masterhost := port("localhost", 1324)
	master.StartServer(masterhost, hd)

	workerhost := port("localhost", 2222)
	StartServer(workerhost, masterhost)

	fmt.Printf("  ... Passed\n")
}