backward compatible from ID to uid for sent_jobs

master
Bel LaPointe 2022-01-27 16:22:58 -07:00
parent d7339c855e
commit ae4c5bd886
2 changed files with 8 additions and 7 deletions

View File

@ -345,7 +345,7 @@ func updateDeadJobs(jobs []broker.Job) error {
wouldBe := strings.TrimPrefix(listEntry, "sent_job_") wouldBe := strings.TrimPrefix(listEntry, "sent_job_")
found := false found := false
for i := range jobs { for i := range jobs {
found = found || jobs[i].ID == wouldBe found = found || jobs[i].UID() == wouldBe || jobs[i].ID == wouldBe
} }
logtr.Debugf("found job %s to be still alive==%v", wouldBe, found) logtr.Debugf("found job %s to be still alive==%v", wouldBe, found)
if !found { if !found {
@ -420,7 +420,7 @@ func sendJob(job broker.Job) (bool, error) {
logtr.Errorf("failed to marshal recorded job: %v", err) logtr.Errorf("failed to marshal recorded job: %v", err)
return return
} }
if err := db.Set("sent_job_"+job.ID, b); err != nil { if err := db.Set("sent_job_"+job.UID(), b); err != nil {
logtr.Errorf("failed to set recorded job: %v", err) logtr.Errorf("failed to set recorded job: %v", err)
return return
} }

View File

@ -1,20 +1,21 @@
todo: todo:
- !states emits current state - fast exact is dumb or...?
- TEST. Just like, refactor and test to shit. - modify old items once no longer available; drop stale jobs good candidate but requires new matrix interaction
- try search ntg by autoinc? - more than NTG; blue one
- !states emits current state
- test each !command callbacks to matrix - test each !command callbacks to matrix
- recv-as for clients so pa receives mas commands as writes - recv-as for clients so pa receives mas commands as writes
- continuation is garbo, but I can still do better client side to avoid get-set high level - continuation is garbo, but I can still do better client side to avoid get-set high level
- no hard code jpeg or have it in multiple places - no hard code jpeg or have it in multiple places
- change matrix so I test my custom logic even if I dont fetch remote - change matrix so I test my custom logic even if I dont fetch remote
- warn/err/etc. on clobbering ids.matrix since clients can mess with one another - warn/err/etc. on clobbering ids.matrix since clients can mess with one another
- modify old items once no longer available; drop stale jobs good candidate but requires new matrix interaction
- more than NTG
- todo: filter out jobs like CA - todo: filter out jobs like CA
subtasks: subtasks:
- banlist criteria like vendors, brokers, metadata - banlist criteria like vendors, brokers, metadata
- set up copy for caleb, broc - set up copy for caleb, broc
done: done:
- try search ntg by autoinc?
- TEST. Just like, refactor and test to shit.
- mark jobs no longer avail by modifying in matrix;; save matrix ID over dummy payload - mark jobs no longer avail by modifying in matrix;; save matrix ID over dummy payload
- TEST its falling apart - TEST its falling apart
- help() log on truckstop for stuff like perma 403 - help() log on truckstop for stuff like perma 403