Compare commits

..

4 Commits

Author SHA1 Message Date
bel
003ffb1231 bad matrix cert ok 2022-02-02 07:12:18 -07:00
bel
cdabce7a56 SH 2022-01-31 09:35:56 -07:00
bel
0ab534624a NO 2022-01-31 09:31:40 -07:00
bel
b3ce49788b little 2022-01-30 08:43:57 -07:00
2 changed files with 21 additions and 4 deletions

10
main.go
View File

@@ -126,7 +126,9 @@ func matrixrecv() error {
logtr.Errorf("failed to mark state gathered @%s: %v", key, err) logtr.Errorf("failed to mark state gathered @%s: %v", key, err)
} }
} }
setNewZips(zips) if config.Get().Brokers.UseZips {
setNewZips(zips)
}
}() }()
func() { func() {
logtr.Verbosef("looking for states") logtr.Verbosef("looking for states")
@@ -150,7 +152,9 @@ func matrixrecv() error {
logtr.Errorf("failed to mark state gathered @%s: %v", key, err) logtr.Errorf("failed to mark state gathered @%s: %v", key, err)
} }
} }
setNewStates(states) if !config.Get().Brokers.UseZips {
setNewStates(states)
}
}() }()
func() { func() {
logtr.Verbosef("looking for radius") logtr.Verbosef("looking for radius")
@@ -371,7 +375,7 @@ func __main() error {
logtr.Errorf("failed _main: %v", err) logtr.Errorf("failed _main: %v", err)
} }
if config.Get().Once { if config.Get().Once {
time.Sleep(3 * time.Second) time.Sleep(10 * time.Second)
return err return err
} }
if err != nil { if err != nil {

View File

@@ -2,6 +2,7 @@ package message
import ( import (
"bytes" "bytes"
"crypto/tls"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"local/truckstop/config" "local/truckstop/config"
@@ -45,7 +46,19 @@ func newMatrix(conf config.Matrix, cont string) Matrix {
} }
func (m Matrix) getclient() (*gomatrix.Client, error) { func (m Matrix) getclient() (*gomatrix.Client, error) {
return gomatrix.NewClient(m.homeserver, m.username, m.token) client, err := gomatrix.NewClient(m.homeserver, m.username, m.token)
if err != nil {
return nil, err
}
client.Client = &http.Client{
Timeout: time.Minute,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
},
}
return client, nil
} }
func (m Matrix) Continuation() string { func (m Matrix) Continuation() string {