skylines icon indicating copy to clipboard operation
skylines copied to clipboard

Add the from_time query parameter to the live tracking endpoints

Open vicb opened this issue 3 years ago • 6 comments

from_time allows specifying a start time as a UNIX timestamp for the endpoints:

  1. /live/<user_id>/json,
  2. /live/<users_id>,
  3. /tracking/latest.json

The endpoint /live/<user_id>/json already supports a latest_update query parameter which is the number of seconds since midnight of the day of the first point. If both from_time and latest_update are specified for this endpoint then the most recent condition wins (i.e. the conditions are ANDed).

Also specifying from_time does not allow retrieving earlier fixes than the maximum age for the endpoints (12h for #1 and #2 and 6h for #3).

Could you please review @Turbo87.

fixes #2277

/cc @indyflyersoft

vicb avatar Dec 22 '20 05:12 vicb

Hum... I'm not sure what's wrong with black here. I ran it on my code :(

Would be nice to have some more feedback in the logs. I'll look into it later.

vicb avatar Dec 22 '20 05:12 vicb

Other changes in this PR:

  • Add the --diff flag for black (lint test) so that error logs are actionable (different versions of black lead to different formatting),
  • Format the code with black (a few minor diffs),
  • Added a sanity check of the /live endpoint as the code has been updated to use TrackingFix.get_from_time() instead of the former TrackingFix.get_latest().

vicb avatar Dec 22 '20 15:12 vicb

Hey @Turbo87 is there anything missing for this to be reviewed, merged and deployed ?

No rush but please let me know if more work is expected from me here.

Thanks !

vicb avatar Jan 27 '21 18:01 vicb

ping ?

vicb avatar Feb 13 '21 01:02 vicb

No rush but please let me know if more work is expected from me here.

sorry, I'm missing time to do a proper review at the moment. lots of other stuff going on. 😞

Turbo87 avatar Feb 18 '21 14:02 Turbo87