Continuing after stream error

This commit is contained in:
Farhan Khan 2022-03-01 05:01:49 +00:00
parent 64052020ea
commit 2b1b57ac4d

View File

@ -3,8 +3,7 @@ package main
import ( import (
"bufio" "bufio"
"encoding/json" "encoding/json"
"fmt"
"log"
// Must be removed later // Must be removed later
"net/http" "net/http"
"strings" "strings"
@ -39,7 +38,7 @@ func StreamPleroma(endpoint string) {
for { for {
_, p, err := ws.ReadMessage() _, p, err := ws.ReadMessage()
if err != nil { if err != nil {
log.Fatal(err) logWarn(err)
break break
} }
@ -62,10 +61,8 @@ func StreamPleroma(endpoint string) {
} }
} }
ws.Close() ws.Close()
time.Sleep(time.Minute * 10) time.Sleep(time.Minute * 10)
} }
} }