mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot
synced 2024-11-22 11:39:20 +02:00
Force commit before count
This commit is contained in:
parent
aca05b4ffa
commit
d4da5358af
|
@ -13,6 +13,9 @@ c.execute(
|
|||
|
||||
conn.commit()
|
||||
|
||||
def force_commit():
|
||||
conn.commit()
|
||||
|
||||
|
||||
def mark_as_watched_movie(original_name=None, ru_name=None, year=None):
|
||||
try:
|
||||
|
@ -38,7 +41,6 @@ def get_already_watched(original_name=None, ru_name=None, year=None):
|
|||
|
||||
|
||||
def get_count_all_watched_movies():
|
||||
conn.commit() # May be fix wrong count
|
||||
return len(c.execute('SELECT * FROM watched_movies').fetchall())
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
from src.fedi_api import get_status, post_status, upload_attachment
|
||||
from src.fmn_states_db import add_state, get_state, clear_all_states
|
||||
from src.fmn_database import get_movies_for_poll, write_votes, read_votes, mark_as_watched_movie, get_already_watched, rewrite_db, reset_poll, get_count_all_watched_movies
|
||||
from src.fmn_database import get_movies_for_poll, write_votes, read_votes, mark_as_watched_movie, get_already_watched, rewrite_db, reset_poll, get_count_all_watched_movies, force_commit
|
||||
from collections import Counter
|
||||
from loguru import logger
|
||||
import time
|
||||
|
||||
|
||||
def text_create_poll():
|
||||
force_commit()
|
||||
count_poll = get_count_all_watched_movies()
|
||||
text_poll = f'''Друзья, {count_poll} голосование за следующий Fediverse Movie Night объявляю открытым!
|
||||
|
||||
|
|
Loading…
Reference in New Issue