-
Notifications
You must be signed in to change notification settings - Fork 15
feat: timestamps back to FDSN format for api query parameter and result #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
04a489e to
a2a7de6
Compare
8ddc8ab to
d2b2f18
Compare
cmd/fdsn-ws/fdsn_event.go
Outdated
| s := fmt.Sprintf("%s|%s|%.3f|%.3f|%.1f|GNS|GNS|GNS|%s|%s|%.1f|GNS|%s|%s\n", eventID, tm.UTC().Format(time.RFC3339Nano), latitude, longitude, depth, eventID, magType, magnitude, loc, eventType) | ||
| s := fmt.Sprintf("%s|%s|%.3f|%.3f|%.1f|GNS|GNS|GNS|%s|%s|%.1f|GNS|%s|%s\n", eventID, tm.Format(fdsn.WsMarshalTimeFormat), latitude, longitude, depth, eventID, magType, magnitude, loc, eventType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: is tm in this scenario already UTC? If tm is localtime, would you get difference results?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though it's unlikely but since we called UTC() previously, we should keep doing it.
cmd/fdsn-ws/fdsn_station.go
Outdated
| if v.StartTime != fdsn.ZeroWsDateTime { | ||
| st := v.StartTime.Time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion(non-blocking): if you like oneliners: if st := v.StartTime.Time; v.StartTime != fdsn.ZeroWsDateTime {
cmd/fdsn-ws/fdsn_station.go
Outdated
| if v.EndTime != fdsn.EmptyWsDateTime { | ||
| et := v.EndTime.Time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: can be one line, see above
wilsonjord
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
…lt. Only StationXML uses new RFC3339
e3c2fb9 to
418be0f
Compare
Previously we deployed in prod
#269
#270
#272
and caused services like shaking layer getting errors, so we rolled back in an hour.
After more detailed clarification https://github.com/orgs/GeoNet/projects/37/views/27?pane=issue&itemId=133985258&issue=GeoNet%7Ctickets%7C18946, the conclusion be:
Only StationXML 1.2 adopts RFC3339 time format. and all other endpoints/responses still using old FDSN format time (similar to RFC3339, but without timezone info).
In this PR, I split the timestamp into two implementations, one for general FDSN use, one specifically for StationXML use.
Deployed in http://tf-dev-fdsn-web-1308277073.ap-southeast-2.elb.amazonaws.com.
====
Last failed deployment resulted in ShakingLayer-api having errors like
I ran shaking layer api locally by pointing FDSN to the updated dev instance and it works without errors.