diff --git a/transaction.go b/transaction.go index b8c25bb94..624161f80 100644 --- a/transaction.go +++ b/transaction.go @@ -390,8 +390,6 @@ func CompareTransactions(t1, t2 Transaction) error { return nil } -const RFC3339NanoNoZone = "2006-01-02T15:04:05.999999999" - func (trns *Transaction) UnmarshalJSON(b []byte) error { tmp := &struct { ID string `json:"id"` @@ -426,7 +424,7 @@ func (trns *Transaction) UnmarshalJSON(b []byte) error { } if tmp.Deadline != "" { - trns.Deadline, err = time.ParseInLocation(RFC3339NanoNoZone, tmp.Deadline, time.UTC) + trns.Deadline, err = time.Parse(time.RFC3339Nano, tmp.Deadline) } return errors.Wrap(err, "parsing deadline") } @@ -443,6 +441,6 @@ func (trns *Transaction) MarshalJSON() ([]byte, error) { Active: trns.Active, Exclusive: trns.Exclusive, Timeout: trns.Timeout.String(), - Deadline: trns.Deadline.In(time.UTC).Format(RFC3339NanoNoZone), + Deadline: trns.Deadline.In(time.UTC).Format(time.RFC3339Nano), }) } diff --git a/transaction.md b/transaction.md index c3bdc27e3..aeefad8bc 100644 --- a/transaction.md +++ b/transaction.md @@ -165,6 +165,7 @@ goes through API (and is passed directly to Server). (unimplemented) - [ ] implement transaction id in header - [x] propagate context - [ ] implement and use persistent transaction store rather than inmem. + - [ ] implement some method for syncing transaction stores - [ ] update go-pilosa/gpexp to actually USE transactions - [ ] update IDK to use updated go-pilosa - [ ] external testing with e.g. curl