logs but no changes

master
Bel LaPointe 2022-01-27 16:34:53 -07:00
parent c56acbc120
commit d456de12e8
2 changed files with 10 additions and 10 deletions

View File

@ -34,7 +34,7 @@
"Pickup": false, "Pickup": false,
"Dropoff": false, "Dropoff": false,
"Pathed": { "Pathed": {
"Enabled": true, "Enabled": false,
"DirectionsURIFormat": "https://maps.googleapis.com/maps/api/directions/json?origin=%s\u0026destination=%s\u0026mode=driving\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg", "DirectionsURIFormat": "https://maps.googleapis.com/maps/api/directions/json?origin=%s\u0026destination=%s\u0026mode=driving\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg",
"PathedURIFormat": "https://maps.googleapis.com/maps/api/staticmap?size=250x250\u0026path=%s\u0026format=jpeg\u0026maptype=roadmap\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg\u0026size=250x250\u0026markers=%s|%s", "PathedURIFormat": "https://maps.googleapis.com/maps/api/staticmap?size=250x250\u0026path=%s\u0026format=jpeg\u0026maptype=roadmap\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg\u0026size=250x250\u0026markers=%s|%s",
"Zoom": { "Zoom": {
@ -69,17 +69,17 @@
"Room": "!OYZqtInrBCn1cyz90D:m.bltrucks.top" "Room": "!OYZqtInrBCn1cyz90D:m.bltrucks.top"
} }
}, },
"Once": true, "Once": false,
"Brokers": { "Brokers": {
"FastExact": { "FastExact": {
"RadiusMiles": 100, "RadiusMiles": 100,
"Enabled": true, "Enabled": true,
"Mock": true, "Mock": true,
"Username": "u", "Username": "birdman",
"Password": "p" "Password": "166647"
}, },
"NTG": { "NTG": {
"Enabled": true, "Enabled": false,
"JobInfo": true, "JobInfo": true,
"Mock": true, "Mock": true,
"LoadPageURIFormat": "https://ntgvision.com/LoadDetails?loadId=%d", "LoadPageURIFormat": "https://ntgvision.com/LoadDetails?loadId=%d",

10
main.go
View File

@ -303,7 +303,7 @@ func once() error {
if ok, err := sendJob(jobs[i]); err != nil { if ok, err := sendJob(jobs[i]); err != nil {
return err return err
} else if ok { } else if ok {
logtr.Debugf("sent job", jobs[i]) logtr.Debugf("sent job %+v", jobs[i])
if err := db.Set(jobs[i].UID(), []byte(`sent`)); err != nil { if err := db.Set(jobs[i].UID(), []byte(`sent`)); err != nil {
return err return err
} }
@ -371,14 +371,14 @@ func updateDeadJobs(jobs []broker.Job) error {
} }
*/ */
if err := message.NewMatrix().Remove(recorded.MatrixID); err != nil { if err := message.NewMatrix().Remove(recorded.MatrixID); err != nil {
return err 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 {
return err logtr.Debugf("failed to remove db: %v: %v", listEntry, err)
} }
for _, imageid := range recorded.MatrixImageIDs { for _, imageid := range recorded.MatrixImageIDs {
if err := message.NewMatrix().Remove(imageid); err != nil { if err := message.NewMatrix().Remove(imageid); err != nil {
return err logtr.Debugf("failed to remove matrix image: %v: %v", imageid, err)
} }
} }
} }
@ -407,7 +407,7 @@ func dropBanlistJobs(jobs []broker.Job) ([]broker.Job, error) {
func sendJob(job broker.Job) (bool, error) { func sendJob(job broker.Job) (bool, error) {
sender := message.NewMatrix() sender := message.NewMatrix()
payload := job.FormatMultilineText() payload := job.FormatMultilineText()
logtr.Debugf("once: send job %s if nonzero: %s", job.String(), payload) logtr.Debugf("once: send job %s if nonzero: %q", job.String(), payload)
if len(payload) == 0 { if len(payload) == 0 {
return false, nil return false, nil
} }