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

Reminder Command Redis Edition #753

Closed

Conversation

Bacon-Fixation
Copy link
Collaborator

@Bacon-Fixation Bacon-Fixation commented Sep 16, 2022

Post Updated 9/24/2022

a Rework of #728 to use Redis TTL

Function

when bot is started, the reminders Table from Postgres is cached to redis and refreshed once a day (also checks for stale reminders that may still be in the Postgres DB due to a possible missed trigger event and either remove them or set up for the next alarm)
uses Redis TTL and a keyspace event listener to trigger the notifications.
uses Direct Messages to function, and was designed to be personal reminders, so most of the responses are ephemeral.
You can set reminders by Text Channel or Direct Message.
All reminders are Direct Messages (can't annoy other people)
if it had a repeat options, then create a new db entry when message is sent (or during clean up check at start up or daily check)

Caveats

  • Reminders being deleted when the Redis Server is Hosted on an Ephemeral Web Services like Heroku ( resolved in 9833b67 )
  • Doesn't account for Daylight Savings Time (just resave your timeOffset with /reminder save-timezone)

Objectives

  • Convert to Redis TTL
  • Sub Commands View/Set/Remove/Save-timezone
  • Small input chain - Minimum of 2 Inputs to set a reminder event and time
  • TimeZones - Get users Timezone offset by asking for Local Date and Time
  • Repeat options - "daily", "weekly", "yearly", "monthly*"
  • Compatible with Pi (arm64)
  • Compatible in dockerized containers (need additional .env variable TZ=<tz-database-name> when using Docker Only)
  • DB maintenance - Checks (at launch and every 24 hours) and remove stale/old Reminders from Postgres, if reminder had a repeat option selected, then recreate reminder for the need time

*Monthly option can only be used if the desired Day is less than the 28th

Much Love
-Bacon

@Bacon-Fixation Bacon-Fixation added the enhancement New feature or request label Sep 16, 2022
@Bacon-Fixation Bacon-Fixation mentioned this pull request Sep 16, 2022
16 tasks
@Bacon-Fixation Bacon-Fixation marked this pull request as draft September 16, 2022 17:29
@Bacon-Fixation
Copy link
Collaborator Author

Bacon-Fixation commented Sep 23, 2022

Testing has started, running it for a bit longer before requesting a review, my apologizes for the delays in the dev .......... time is rough to deal with

TZ=<bot-time-zone> is required in the .env for Docker implementation of master-bot only or all time will be off by double

Much Love
-Bacon

@Bacon-Fixation Bacon-Fixation marked this pull request as ready for review September 26, 2022 12:08
@galnir
Copy link
Owner

galnir commented Sep 27, 2022

Sorry bout the timing but the routers will need to get updated to tRPC v10 when I merge #760 (just need to test it a bit more) 😶‍🌫️

@Bacon-Fixation
Copy link
Collaborator Author

Bacon-Fixation commented Sep 27, 2022

No worries my friend, sounds good.

Much Love
-Bacon

@Bacon-Fixation Bacon-Fixation marked this pull request as draft September 29, 2022 15:08
@Bacon-Fixation Bacon-Fixation mentioned this pull request Sep 29, 2022
9 tasks
@Bacon-Fixation
Copy link
Collaborator Author

Closing for the TRPC v10 PR

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

Successfully merging this pull request may close these issues.

2 participants