From 19d89b28d896962bac9318d38b4f7cda93b42b55 Mon Sep 17 00:00:00 2001 From: cx uname Date: Tue, 25 Feb 2014 17:07:44 +0400 Subject: [PATCH] dc refactoring --- main.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 35a9b90..379c66c 100644 --- a/main.go +++ b/main.go @@ -32,23 +32,22 @@ func main() { ) start: if Conn != nil { + time.Sleep(5 * time.Second) log.Println("Conn check:", Conn.Close()) + time.Sleep(5 * time.Second) } Conn, err = xmpp.Dial("xmpp.ru:5222", "hypnotoad", "xmpp.ru", "pass", "AllHailHypnotoad", nil) if err != nil { log.Println("Conn", err) - time.Sleep(5 * time.Second) goto start } if err := Conn.SignalPresence("dnd", "is there some food in this world?", 12); err != nil { log.Println("Signal", err) - time.Sleep(5 * time.Second) goto start } if err := Conn.SendPresence(room+"/"+name, ""); err != nil { log.Println("Presence", err) - time.Sleep(5 * time.Second) goto start } @@ -82,7 +81,6 @@ start: case next = <-cs: case <-time.After(65 * time.Second): log.Println(Conn.Close(), "\n\t", "closed after 65 seconds of inactivity") - time.Sleep(5 * time.Second) goto start } switch t := next.Value.(type) { @@ -102,7 +100,6 @@ start: } } log.Println(Conn.Close(), "\n\t", "wtf am I doing here?") - time.Sleep(5 * time.Second) goto start }