Skip to content

Commit

Permalink
fixed typo in reading env
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Seidel committed Aug 23, 2019
1 parent c4d0abc commit d87b7cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
10 changes: 7 additions & 3 deletions exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ func main() {
os.Exit(2)
}

xmppPort, ok := os.LookupEnv("XMPP_SERVER")
xmppPort, ok := os.LookupEnv("XMPP_PORT")
if !ok || xmppPort == "" {
xmppPort = "5222"
}

xmppServer, ok := os.LookupEnv("XMPP_PORT")
xmppServer, ok := os.LookupEnv("XMPP_SERVER")
if !ok {
fmt.Println("no xmpp server specified")
os.Exit(2)
Expand Down Expand Up @@ -111,14 +111,18 @@ func handlePresence(s xmpp.Sender, p stanza.Packet) {

}

func postConnect(s xmpp.Sender) {
fmt.Println("connected")
}

func connectClient(c xmpp.Config, r *xmpp.Router) {
client, err := xmpp.NewClient(c, r)
if err != nil {
fmt.Printf("unable to create client: %s\n", err.Error())
signals <- iFail
}

cm := xmpp.NewStreamManager(client, nil)
cm := xmpp.NewStreamManager(client, postConnect)
err = cm.Run()
if err != nil {
fmt.Printf("xmpp connection manager returned with error: %s\n", err.Error())
Expand Down

0 comments on commit d87b7cc

Please sign in to comment.