iuriguilherme / iacecil

O repositório mais fofo do Github
GNU General Public License v3.0
3 stars 1 forks source link

Cache chat information #1

Open iuriguilherme opened 2 years ago

iuriguilherme commented 2 years ago

Chat information in the updates/ route is requested everytime the page GET or POST, which is not a blocking call (uses aiohttp) but it slows down because it's a telegram api request subject to rate limit, also the routine is an unecessary bloat of list comprehensions with tests.

Proposed solution is having a file in the form of instance/zodb/123botid.456chatid.meta.fs with versioned information which can be manually updated via a route.

Also this is required because there are private groups where some of the bots have been already kicked and therefore none of them can request information. It would be desirable that such a route bruteforces on all available bots from information on chats for this particular reason.

All routines which request information about chats should use latest valid information stored on zodb filesystem/database.