mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
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:
committed by
Seif Lotfy سيف لطفي
parent
34b4b25092
commit
df3d5b48ce
@@ -146,7 +146,8 @@ func (s *Server) Run(ctx context.Context) {
|
||||
|
||||
// By default it serves on :8080 unless a
|
||||
// PORT environment variable was defined.
|
||||
s.Router.Run()
|
||||
go s.Router.Run()
|
||||
<-ctx.Done()
|
||||
}
|
||||
|
||||
func bindHandlers(engine *gin.Engine, reqHandler func(ginC *gin.Context), taskHandler func(ginC *gin.Context)) {
|
||||
|
||||
Reference in New Issue
Block a user