From bc2f1fb79d72ac0317d74358c0790972453ce3af Mon Sep 17 00:00:00 2001 From: Francois Date: Tue, 13 May 2014 17:19:50 +0200 Subject: [PATCH] Update app.go --- app.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app.go b/app.go index f252367b..80d8d575 100644 --- a/app.go +++ b/app.go @@ -62,10 +62,14 @@ func (app *App) Run() { BeeLogger.Critical("ResolveTCPAddr:", err) } l, err = GetInitListener(laddr) - theStoppable = newStoppable(l) - err = server.Serve(theStoppable) - theStoppable.wg.Wait() - CloseSelf() + if err == nil { + theStoppable = newStoppable(l) + err = server.Serve(theStoppable) + if err == nil { + theStoppable.wg.Wait() + err = CloseSelf() + } + } } else { s := &http.Server{ Addr: addr,