mirror of
https://github.com/Lomanic/presence-button-web
synced 2024-11-21 21:17:29 +00:00
Don't panic at runtime in case of temporary network hiccups
This commit is contained in:
parent
d3d1b1676c
commit
ef10e0fcb4
4
main.go
4
main.go
@ -244,7 +244,7 @@ func syncMatrix() {
|
|||||||
go func() { // set online status every 15 seconds
|
go func() { // set online status every 15 seconds
|
||||||
for {
|
for {
|
||||||
if err := matrix.SetStatus("online", "up and running"); err != nil {
|
if err := matrix.SetStatus("online", "up and running"); err != nil {
|
||||||
panic(fmt.Sprintf("error setting matrix status: %s", err))
|
fmt.Println("error setting matrix status:", err)
|
||||||
}
|
}
|
||||||
time.Sleep(15 * time.Second)
|
time.Sleep(15 * time.Second)
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ func syncMatrix() {
|
|||||||
|
|
||||||
for {
|
for {
|
||||||
if err := matrix.Sync(); err != nil {
|
if err := matrix.Sync(); err != nil {
|
||||||
fmt.Println("Sync() returned ", err)
|
fmt.Println("error syncing with matrix:", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user