Conversation
b02bfeb to
e2bbae4
Compare
- add restful refresh endpoint - add graphql refresh endpoint [Delivers CON-269]
e2bbae4 to
632f856
Compare
joshuaocero
left a comment
There was a problem hiding this comment.
@mnswaleh this is a well-written feature, please see some of my recommendations though. Also, after the registerChannels() feature is implemented, we'll have to call that functionality after the refresh. Please make a mental note of that.
|
|
||
| from api.v2.controllers.channels.channels_controller import Channels | ||
| from api.v2.controllers.boquets.bouquets_controller import Bouquets | ||
| from api.v2.controllers.boquets.bouquets_controller import ( |
There was a problem hiding this comment.
Please let's fix the typo boquets, it should be bouquet.
| bouquet = query_bouquet(bouquet_id) | ||
| if bouquet: | ||
| response = {'response': | ||
| {"Error": "Refresh endpoint not responding appropriatly"}, |
There was a problem hiding this comment.
Please correct typo appropriatly
| if bouquet: | ||
| response = {'response': | ||
| {"Error": "Refresh endpoint not responding appropriatly"}, | ||
| 'code': 424 |
There was a problem hiding this comment.
Any reason why we are using this HTTP status code? It seems to represent failed dependencies and does not seem to be a standard HTTP status code. Please shed some more light here.
There was a problem hiding this comment.
This is to check if the refresh URL endpoint is responding as required. If an error occurs at this point it is to be because of that dependency and not necessarily on our endpoint
| return bouquet | ||
|
|
||
|
|
||
| def refresh_bouquet_channels(api_type, bouquet_id): |
There was a problem hiding this comment.
This operation can take a while if you are waiting for a response. Let's consider using Celery to queue requests and create a notifications table to store tasks statuses which users will use to monitor their tasks.
Description
This pull request creates an endpoint that refreshes channels in a particular bouquet.
How can This be tested
git clone https://github.com/andela/mrm_api.gitReadme.mdstory/CON-297-refresh-channels-on-bouquetv2/refresh/restful_api/<bouquet_id>with a post requestv2/refresh/graphql_api/<bouquet_id>with a post requestalembic stamp ____alembic upgrade headpytest --cov=api/v2 --cov-report=term-missingType of change
Please select the relevant option
Checklist:
JIRA
CON-297
Relevant screenshots: