Compare commits

..

26 Commits

Author SHA1 Message Date
Bel LaPointe
3b4dd1ba70 do not delete old jobs text 2022-02-24 09:23:22 -07:00
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
bel
bbe839bb88 make working hours, weekdays configurable by impl ntg 2022-01-30 08:34:14 -07:00
bel
60f19968e3 add ntg configurable work hours, weekdays 2022-01-30 08:29:06 -07:00
bel
c62d84b40a cache last ntg result for off hours 2022-01-29 18:59:16 -07:00
bel
1a072fee59 Merge branch 'master' of http://gogs.scratch.com:59515/bel/truckstop 2022-01-29 18:44:21 -07:00
bel
c4213e697d fuck backwards bool 2022-01-29 18:44:13 -07:00
bel
934a306bc9 log 2022-01-29 18:40:13 -07:00
Bel LaPointe
82bdbb1f3b todo 2022-01-27 20:18:13 -07:00
Bel LaPointe
b090cb86a5 fix offset to not need system timezone 2022-01-27 20:04:31 -07:00
Bel LaPointe
e42df54632 only do ntgvision searches 9-4 EST because 417s mean unauth until forced pw reset 2022-01-27 19:53:50 -07:00
Bel LaPointe
0120fdd0e2 accept !radius for miles radius search 2022-01-27 19:21:03 -07:00
Bel LaPointe
eab73aec04 include one very nice log 2022-01-27 19:00:40 -07:00
Bel LaPointe
bd9dca9766 remove unwanted from help, only print !zip or !state as configured 2022-01-27 18:53:56 -07:00
Bel LaPointe
56f7d093ef fix typo in config.json for == in query 2022-01-27 18:49:05 -07:00
Bel LaPointe
62b413c033 debug to verbose logs 2022-01-27 18:46:59 -07:00
Bel LaPointe
3adcee2fbe whoosp backwards if body 2022-01-27 18:41:58 -07:00
Bel LaPointe
e916b5abfc job filters by zip or state depending on config 2022-01-27 18:35:40 -07:00
Bel LaPointe
211ef64261 support logging zip changes 2022-01-27 18:27:01 -07:00
Bel LaPointe
bb8e2a18ef main will search zips if Broker.UseZips, ntg does its own filtering by city-state dist from search-zips 2022-01-27 18:20:52 -07:00
Bel LaPointe
d2cf8c74a2 ntgvision maps zips to states then does same query 2022-01-27 18:14:49 -07:00
Bel LaPointe
db289cb5c8 impl and test zip.Get, MilesTo, GetStatesWithin, FromCityState 2022-01-27 18:11:11 -07:00
Bel LaPointe
128c98dfbd impl zip.Get for translating zip to info and calc dist 2022-01-27 17:58:00 -07:00
3 changed files with 33141 additions and 6 deletions

11
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")
@@ -522,9 +526,6 @@ func updateDeadJobs(jobs []broker.Job) error {
return err 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 { if err := db.Set(listEntry, nil); err != nil {
logtr.Debugf("failed to remove db: %v: %v", listEntry, err) logtr.Debugf("failed to remove db: %v: %v", listEntry, err)
} }

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 {

File diff suppressed because it is too large Load Diff