start cache clearing loop

This commit is contained in:
LBlend committed 2023-04-22 20:49:11 +09:00
1 parent eb52a02016
commit 7f429da6b1
1 file changed
+4 -2
+4 -2
View File
@@ -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)