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

Groom database to remove stale memes #54

Open
leviable opened this issue May 5, 2016 · 0 comments
Open

Groom database to remove stale memes #54

leviable opened this issue May 5, 2016 · 0 comments

Comments

@leviable
Copy link
Member

leviable commented May 5, 2016

The current implementation of Dankbot stores all memes in a database that have been successfully posted to Slack. When a new Dankbot run is started, and memes are pulled from subreddits, their links are first compared against the database, and any memes already in the database are removed. While this approach works, it allows the database to grow in an unbounded manner, as stale memes are never removed from the database.

Alter Dankbot do do the following:

  • Add a "last seen" column to the 'memes' table, which will contain a datetime string
  • If a meme is found in the database, update it's datetime string
  • Add an entry to the dankbot.ini to specify how long, in days, a meme entry must be stale before it is groomed out of the database
  • Add a new method to Dankbot that grooms the database, removing any memes that haven't been seen in X days, where X is the number of days specified in the dankbot.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant