tdmalone / slackemon

Inspired by Pokémon Go, now you can catch and battle Pokémon with your teammates on Slack!
GNU General Public License v3.0
10 stars 3 forks source link

Pruning of stale spawn, battle and move data #28

Closed tdmalone closed 7 years ago

tdmalone commented 7 years ago

Given that the Postgres data store is now active, we also need a way to prune stale spawn, battle and move data - otherwise the database is just going to fill up and reach limits (eg. 10k row limit on Heroku free).

All of the content in spawns, battles_active, battles_complete, battles_invites and moves can be cleared after 24 hours (even earlier probably, but this should be safe), and this could be done by cron.

tdmalone commented 7 years ago

Also - S3 will by default only return up to 1000 objects at a time. So we should ensure we don't exceed this, otherwise we need to make sure we cater for pulling additional pages of objects.

tdmalone commented 7 years ago

Fixed in https://github.com/tdmalone/slackemon/commit/333e65ccadd5b7e7e65d5bc93d9048dbd55b88e3.

Todo notices added in https://github.com/tdmalone/slackemon/commit/335613c68dc92f95ae7a3b0a0d48885168869d7a for potential future enhancements.