Closed heaven00 closed 5 years ago
Picking this up
I would like to pick up.
@javatarz @heaven00
Scenario1:
1. user ids will stored in json file.
2. When app refreshes, we will fetch user_ids from json instead of constant. This way, app restart not required.
Other suggestions:
instead of json, it could be redis, so user don't have to commit changes when user_ids are need to updated.
Redis might be overkill at the moment.
Let's stick to JSON also, can you think about adding a test for it?
@heaven00 made changes after review comment. please check and let me know.
+1 on Redis being overkill. For an app as small as this, a simple dictionary that removes things after a timeout works fine.
Also, I'm curious about the users.json
change. I'd like all the configuration to be in the same spot. I'm not a huge fan of building config files and distributing sample files to explain the structure to people. The advantage with CLI args is that when you make a mistake during startup, it's instant feedback.
We should probably move to accepting users through a REST endpoint eventually with a simple UI feature. I'd prefer that over a JSON config any day. I feel like the JSON config isn't a step in the direction of the REST endpoint.
I might be looking at this incorrectly. I'd love to hear your thoughts @sathia27 and @heaven00 :) Thanks once again for contributing to this project! Hope to keep improving this project together as a community ^_^
the idea is that users.json
is not a config but a data file that contains user ids sort of a quick and dirty solution but we can do an API endpoint for it too, then probably we need to store the data at some place too @sathia27 @javatarz sqlite
? or just a file
? so that the app can restart with the current set.
Playing devil's advocate here.. what about an in memory dictionary? sqlite is fine for me. Using a dict means you pass the users when you start the app. That's ok by me. If you do sqlite, that's fine too. :)
Point is, keep it lite, simple and easy ;)
Just had a word with @heaven00 offline. I'm going to close this ticket and he's going to raise one to add an end-point for the post request to add more users to an in-memory dictionary or sqlite.
Value statement
Describe the solution you'd like A clear and concise description of what you want to happen.