Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b4dd1ba70 | ||
|
|
003ffb1231 | ||
|
|
cdabce7a56 | ||
|
|
0ab534624a | ||
|
|
b3ce49788b |
13
main.go
13
main.go
@@ -126,7 +126,9 @@ func matrixrecv() error {
|
||||
logtr.Errorf("failed to mark state gathered @%s: %v", key, err)
|
||||
}
|
||||
}
|
||||
setNewZips(zips)
|
||||
if config.Get().Brokers.UseZips {
|
||||
setNewZips(zips)
|
||||
}
|
||||
}()
|
||||
func() {
|
||||
logtr.Verbosef("looking for states")
|
||||
@@ -150,7 +152,9 @@ func matrixrecv() error {
|
||||
logtr.Errorf("failed to mark state gathered @%s: %v", key, err)
|
||||
}
|
||||
}
|
||||
setNewStates(states)
|
||||
if !config.Get().Brokers.UseZips {
|
||||
setNewStates(states)
|
||||
}
|
||||
}()
|
||||
func() {
|
||||
logtr.Verbosef("looking for radius")
|
||||
@@ -371,7 +375,7 @@ func __main() error {
|
||||
logtr.Errorf("failed _main: %v", err)
|
||||
}
|
||||
if config.Get().Once {
|
||||
time.Sleep(3 * time.Second)
|
||||
time.Sleep(10 * time.Second)
|
||||
return err
|
||||
}
|
||||
if err != nil {
|
||||
@@ -522,9 +526,6 @@ func updateDeadJobs(jobs []broker.Job) error {
|
||||
return err
|
||||
}
|
||||
*/
|
||||
if err := message.NewMatrix().Remove(recorded.MatrixID); err != nil {
|
||||
logtr.Debugf("failed to remove matrix: %v: %v", recorded.MatrixID, err)
|
||||
}
|
||||
if err := db.Set(listEntry, nil); err != nil {
|
||||
logtr.Debugf("failed to remove db: %v: %v", listEntry, err)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package message
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"local/truckstop/config"
|
||||
@@ -45,7 +46,19 @@ func newMatrix(conf config.Matrix, cont string) Matrix {
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user