mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot.git
synced 2024-12-23 12:19:47 +00:00
f**king sqlite error on threading...
This commit is contained in:
parent
cdd130b36d
commit
fe6fc2a415
@ -8,23 +8,19 @@ from dateutil.parser import parse as dateutilparse
|
||||
from dateutil.relativedelta import relativedelta, TU, SU
|
||||
from loguru import logger
|
||||
|
||||
lock = threading.Lock()
|
||||
|
||||
def get_control_mention():
|
||||
while True:
|
||||
time.sleep(30)
|
||||
time_now = datetime.now()
|
||||
now_week = time_now.weekday()
|
||||
now_hour = time_now.hour
|
||||
if now_week not in (0, 6):
|
||||
time.sleep(30)
|
||||
continue
|
||||
if now_week == 6 and now_hour <= fmn_next_watching_hour: # Предотвращение работы в холстую до начала сеанса
|
||||
time.sleep(30)
|
||||
if now_week == 6 and now_hour < fmn_next_watching_hour: # Предотвращение работы в холстую до начала сеанса
|
||||
continue
|
||||
with lock:
|
||||
post_exists = get_state('last_thread_id')
|
||||
post_exists = get_state('last_thread_id')
|
||||
if post_exists:
|
||||
time.sleep(30)
|
||||
continue
|
||||
logger.debug('Wait for from admin mention...')
|
||||
notif = get_notifications()
|
||||
|
Loading…
Reference in New Issue
Block a user