refactor setting TTL in vehicles.js
See original GitHub issueThank you for your help ❤️
What is this project?
DAV (Decentralized Autonomous Vehicles) is a new foundation working to build an open-source infrastructure for autonomous vehicles (cars, drones, trucks, robots, and all the service providers around them) to communicate and transact with each other over blockchain.
The specific project you are looking at is Mission Control. It is the brain in charge of orchestrating missions between DAV users and autonomous vehicles.
How you can help
Mission Control comes with a built in simulation environment which generates and controls simulated vehicles, allowing developers to start developing without investing in costly hardware first.
One of the things the simulator does is keep track of requests for delivery missions.
Once created, those simulated requests remain indefinitely in memory.
Once we have many developers from around the world experimenting with the simulation environment, more and more requests will be created and kept in memory and never deleted.
What you can do
We need to add a TTL (Time To Live) expiration to the requests stored in Redis so that they are deleted automatically after some time.
In the file /server/store/vehicles.js
the code used to set TTL
redis.expire(`vehicles:${vehicle.id}`, config('vehicles_ttl'));
is repeated twice. The task for this issue is to refactor that code by moving it to a separate function with the name setVehicleTTL(vehicleId)
.
Contributing to Mission Control
- Make sure this issue is labeled
up-for-grabs
and not labeledclaimed
, to verify no one else is working on it. - Comment in this issue that you would like to do it.
- Open the Mission Control GitHub page and click the ★ Star and then ⑂ Fork buttons.
- Clone a copy to your local machine with
$ git clone git@github.com:YOUR-GITHUB-USER-NAME/missioncontrol.git
- **Code Code Code **
- Once you’ve made sure all your changes work correctly and committed all your changes, push your local changes back to github with
$ git push -u origin master
- Visit your fork on GitHub.com (https://github.com/YOUR-USER-NAME/missioncontrol) and create a pull request for your changes.
- Make sure your pull request describes exactly what you changed and references this issue (include the issue number in the title like this:
#5
) - Please do not fix more than one issue at a time. Your pull request should only fix what is described in this issue.
Asking for help
We appreciate your effort in taking the time to work on this issue and help out the open source community and the foundation. If you need any help, feel free to ask below or in our gitter channel. We are always happy to help 😄
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
Thanks a lot for your help!
Congratulations @hmainismael on your first contribution to open source! And thank you being patient and fixing the additional review comments. We really appreciate it. Hope you had fun and learned few things doing this PR. Feel free to join our gitter channel to find out more opportunities 🙂