mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot
synced 2024-11-22 10:39:18 +02:00
Barebones fix again sqlite error: Recursive use of cursors not allowed.
This commit is contained in:
parent
2e45cc987c
commit
cdd130b36d
|
@ -8,6 +8,7 @@ from dateutil.parser import parse as dateutilparse
|
||||||
from dateutil.relativedelta import relativedelta, TU, SU
|
from dateutil.relativedelta import relativedelta, TU, SU
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
|
lock = threading.Lock()
|
||||||
|
|
||||||
def get_control_mention():
|
def get_control_mention():
|
||||||
while True:
|
while True:
|
||||||
|
@ -17,10 +18,12 @@ def get_control_mention():
|
||||||
if now_week not in (0, 6):
|
if now_week not in (0, 6):
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
continue
|
continue
|
||||||
if get_state('last_thread_id'):
|
if now_week == 6 and now_hour <= fmn_next_watching_hour: # Предотвращение работы в холстую до начала сеанса
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
continue
|
continue
|
||||||
if now_week == 6 and now_hour <= fmn_next_watching_hour: # Предотвращение работы в холстую до начала сеанса
|
with lock:
|
||||||
|
post_exists = get_state('last_thread_id')
|
||||||
|
if post_exists:
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
continue
|
continue
|
||||||
logger.debug('Wait for from admin mention...')
|
logger.debug('Wait for from admin mention...')
|
||||||
|
|
Loading…
Reference in New Issue