Fix race condition during initialization (#163)

Currently, async workers are started before HTTP interface is available
to get their requests. It fixes by ensuring that async workers are
started after HTTP interface is up.

Essentially we are getting rid of an error message during bootstrap:

        ERRO[0000] Could not fetch task error=Get http://127.0.0.1:8080/tasks: dial tcp 127.0.0.1:8080: getsockopt: connection refused
This commit is contained in:
C Cirello
2016-10-13 22:56:34 +02:00
committed by Seif Lotfy سيف لطفي
parent 34b4b25092
commit df3d5b48ce
6 changed files with 60 additions and 22 deletions

View File

@@ -204,7 +204,7 @@ func TestTasksrvURL(t *testing.T) {
}
for _, tt := range tests {
if got := tasksrvURL(tt.in, tt.port); got != tt.out {
if got, _ := tasksrvURL(tt.in, tt.port); got != tt.out {
t.Errorf("port: %s\ttasksrv: %s\texpected: %s\tgot: %s", tt.port, tt.in, tt.out, got)
}
}