-
Notifications
You must be signed in to change notification settings - Fork 5
[Feature] Task Queue System & Rate Limit on API #335
base: develop
Are you sure you want to change the base?
Conversation
2f181c0
to
78b5d7e
Compare
…into feature/celery
Oh ! I think i know the problem , For me it works because I use ssh tunnel , But may not work for the postgres lying on local machine. Since docker container is requesting connection outside the network when we specify localhost : container reference to it's own locahost instead , Try replacing it with your device network ip address it should be able to connect ! ( I use ifconfig to know ip ) . Let me know if it works ! I will include this in docs as well |
Update : Replacing my network ip with localhost worked for me with my local Postgres ! I found this article as well |
…outside container
|
||
|
||
@router.post("/current-snapshot/") | ||
@limiter.limit(f"{export_rate_limit}/minute") |
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.
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.
I will add limit info on doc and raise formatted error response
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.
Like my only remaining feedback is on documentation of an endpoint which is migrating (#348), for my side, I think this PR can be merged.
Resolve [DISCUSSION] Implement Queue System and Background Task Processing on Galaxy-API #318
Resolve [FEATURE] Integrate full installation of API through Github Workflow #336 Adds Docker for Easy installation with redis , celery and flower
Resolve [FEATURE] Integrate sample data in unittest workflow #337 Setup tests with sample data and database so that future test integrations can use sample requests
Resolve Have Documentation for easy docker setup in dev environment #338 Updates docs with installation instruction
Resolve [FEATURE] Integrate full installation of API through Github Workflow #336 Adds a build workflow to showcase successful build of API with celery and redis in ubuntu here
Resolve [FEATURE] Introduce Rate limiting on API #339, Uses Slowapi for rate limiting , Accepts value from config for limiting and can be extended to other endpoints
This will also solve failing Github action issue of #326
Features :
Implementation details :
Test This PR :
Simply checkout this
feature/celery
branch and start from docs/GETTING_SARTED_WITH_DOCKER hereThis PR involves some major changes on documentation so I recommend going through docs will be very useful to test it
Once the API is up and running ,
post Sample request provided on rawdata endpoint
It should give you your unique task id.
Follow the steps to track status
Meanwhile navigate to flower To see what worker is doing and job status / info
You can hit the /current-snapshot/ multiple times when you reach more than 5 request per min ,API will block the request and You should see too many requests error