Compare commits

...

3 Commits

Author SHA1 Message Date
bel
b451ed93bf origin from date lower 2022-01-18 11:27:32 -07:00
bel
76b7211d6c todo 2022-01-18 07:55:25 -07:00
bel
31a608d7f8 whoops tahts not an err 2022-01-18 07:46:24 -07:00
2 changed files with 3 additions and 2 deletions

View File

@@ -93,7 +93,7 @@ func (ntgJob *ntgVisionJob) JobInfo() (ntgVisionJobInfo, error) {
key := fmt.Sprintf("ntg_job_info_%v", ntgJob.ID) key := fmt.Sprintf("ntg_job_info_%v", ntgJob.ID)
if b, err := db.Get(key); err != nil { if b, err := db.Get(key); err != nil {
} else if err := json.Unmarshal(b, &ntgJob.jobinfo); err == nil { } else if err := json.Unmarshal(b, &ntgJob.jobinfo); err == nil {
return ntgJob.jobinfo, fmt.Errorf("failed to parse ntg job info from db: %w: %s", err, b) return ntgJob.jobinfo, nil
} }
ntg := NewNTGVision() ntg := NewNTGVision()
ji, err := ntg.SearchJob(ntgJob.ID) ji, err := ntg.SearchJob(ntgJob.ID)
@@ -305,7 +305,7 @@ func (ntg NTGVision) _search(states []config.State) (io.ReadCloser, error) {
func (ntg NTGVision) newRequest(states []config.State) (*http.Request, error) { func (ntg NTGVision) newRequest(states []config.State) (*http.Request, error) {
body, err := json.Marshal(map[string]interface{}{ body, err := json.Marshal(map[string]interface{}{
"OriginFromDate": time.Now().UTC().Format("2006-01-02T15:04:05.000Z"), "OriginFromDate": time.Now().Add(time.Hour * -24).UTC().Format("2006-01-02T15:04:05.000Z"),
"OriginToDate": time.Now().UTC().Add(time.Hour * 24 * 30).Format("2006-01-02T15:04:05.000Z"), "OriginToDate": time.Now().UTC().Add(time.Hour * 24 * 30).Format("2006-01-02T15:04:05.000Z"),
"DestinationFromDate": nil, "DestinationFromDate": nil,
"DestinationToDate": nil, "DestinationToDate": nil,

View File

@@ -1,4 +1,5 @@
todo: todo:
- !states emits current state
- TEST. Just like, refactor and test to shit. - TEST. Just like, refactor and test to shit.
- try search ntg by autoinc? - try search ntg by autoinc?
- test each !command callbacks to matrix - test each !command callbacks to matrix