-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust timeouts and improve logging (#53)
- Loading branch information
1 parent
422b92b
commit e9a69df
Showing
17 changed files
with
90 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
from datetime import timedelta | ||
from typing import Tuple | ||
|
||
import flask | ||
from uas_standards.astm.f3411.v19.constants import Scope | ||
|
||
from . import handling | ||
from .app import webapp | ||
from .config import KEY_QUERY_TIMEOUT | ||
from .oauth import requires_scope | ||
from .requests import RIDObservationGetDisplayDataRequest, RIDObservationGetDetailsRequest | ||
|
||
timeout = timedelta(seconds=webapp.config[KEY_QUERY_TIMEOUT]) | ||
|
||
|
||
@webapp.route('/riddp/observation/display_data', methods=['GET']) | ||
@requires_scope([Scope.Read]) | ||
def rid_observation_display_data() -> Tuple[str, int]: | ||
"""Implements retrieval of current display data per automated testing API.""" | ||
return handling.fulfill_query(RIDObservationGetDisplayDataRequest(view=flask.request.args['view'])) | ||
return handling.fulfill_query(RIDObservationGetDisplayDataRequest(view=flask.request.args['view']), timeout) | ||
|
||
|
||
@webapp.route('/riddp/observation/display_data/<flight_id>', methods=['GET']) | ||
@requires_scope([Scope.Read]) | ||
def rid_observation_flight_details(flight_id: str) -> Tuple[str, int]: | ||
"""Implements get flight details endpoint per automated testing API.""" | ||
return handling.fulfill_query(RIDObservationGetDetailsRequest(id=flight_id)) | ||
return handling.fulfill_query(RIDObservationGetDetailsRequest(id=flight_id), timeout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.