markov: Finish up chain database implementation
Markov now uses a sqlite3 database instead of flat JSON files. This should significantly speed up saving time, plus reduce the amount of RAM that it uses. Saving and loading large JSON files was very slow and caused issues with other plugins, especially when messages were received. Additionally, in order to save RAM, a cache was used and periodically flushed when not used, adding some complications to the implementation. This has all been removed since things get committed on the fly with the database implementation. The main trade-off we have to make is the disk space used by the database. This is OK though, because disk space is cheap while RAM is not. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -40,7 +40,7 @@ async def main():
|
||||
name = mat["name"]
|
||||
message = mat["message"].strip()
|
||||
if name != server_config.nick and message and message[0] != "!":
|
||||
plugin.add(channel, name, message)
|
||||
plugin.add(channel, name, message, commit=False)
|
||||
await plugin.save()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user