Skip to content
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

Open
bryanjwong opened this issue Dec 7, 2021 · 4 comments
Open

lab open state stored in local state #13

bryanjwong opened this issue Dec 7, 2021 · 4 comments

Comments

@bryanjwong
Copy link
Member

Currently, lab open state is stored as a local variable in bot server instance:

lab_open = True

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.

@RogueArt
Copy link
Contributor

RogueArt commented Jan 5, 2022

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.

@bryanjwong
Copy link
Member Author

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?

@ble86
Copy link
Contributor

ble86 commented Jan 5, 2022

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.

@RogueArt
Copy link
Contributor

RogueArt commented Jan 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants