mirror of
https://github.com/UiO-Gaming/mustafa.git
synced 2026-11-05 13:56:48 +01:00
start cache clearing loop
This commit is contained in:
1 file changed
+4
-2
@@ -11,7 +11,7 @@ import nltk
|
||||
from nltk.corpus import stopwords
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
from psycopg2.extras import execute_values
|
||||
from psycopg2.extras import execute_batch
|
||||
import re
|
||||
from wordcloud import WordCloud as WCloud # Avoid naming conflicts with cog class name
|
||||
# from wordcloud import ImageColorGenerator
|
||||
@@ -42,6 +42,8 @@ class WordCloud(commands.Cog):
|
||||
|
||||
nltk.download('stopwords')
|
||||
|
||||
self.batch_update_word_freqs_loop.start()
|
||||
|
||||
def init_db(self):
|
||||
"""
|
||||
Create the necessary tables for the Ordsky cog to work
|
||||
@@ -98,7 +100,7 @@ class WordCloud(commands.Cog):
|
||||
|
||||
# Insert cache into database
|
||||
try:
|
||||
execute_values(
|
||||
execute_batch(
|
||||
self.cursor,
|
||||
"""
|
||||
INSERT INTO wordcloud_words (discord_user_id, word, frequency)
|
||||
|
||||
Reference in new issue
Block a user