-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lab open state stored in local state #13
Comments
Since Heroku supports both PostgreSQL and Redis out of the box, it could be a cleaner/more scalable fix. It does take some setup on your end to provision the database, but let me know if using Sheets or if using Heroku's PSQL makes more sense to you and then I'll proceed from there on. |
I think it's probably a bit overkill to provision a PostgreSQL/Redis for a single state value, and also introduces additional complexity to our tech stack. We also already use GSheets to read lab hours, so adding this feature there should be fairly quick. We do currently use Firebase for some lab bucks stuff I believe, but I'd also prefer to have that separated from the core functionality to reduce tech bloat (and to make deprecation of the lab bucks functionality easy should we decide to stop using it in the future). @bschulz01 @ble86 added this feature, thoughts? |
I don't have any experience with the solutions talked about (PostgreSQL and Redis), but I could potentially see a solution using Google sheets as Bryan proposes where one of the Lab Hours sheets becomes a "dates open" sheet and parses to have the lab open on those dates listed in the sheet. I don't know what the proposed solution using Firebase is, and Bradley is more of the expert on the lab bucks and Firebase implementation, but I agree it should probably be separate from the main bot functionality. |
That's fair, I'll get that set up using Google Sheets in the next few days. I agree, it adds a lot of complexity to our tech stack to handle literally one boolean and when/if we need to really scale up, then we can add PostgreSQL or Firebase at that point. |
Currently, lab open state is stored as a local variable in bot server instance:
sparkieee/bot.py
Line 10 in 45022e0
Because free Heroku dynos (our current method of deployment) must cycle once a day, this state is lost. As a result, lab state does not remain closed over longer break periods. An officer must manually use
.closelab
command once a day to prevent reminder messages from being sent.Proposed solution: store lab open state in some sort of persistent storage that is read/written to. Since existing code relies on reading from predefined google sheets document, I suggest having some cell/sheet dedicated to storing this state.
The text was updated successfully, but these errors were encountered: