added delays

This commit is contained in:
2026-04-05 11:56:16 +03:00
parent 3b15cd5037
commit 4e357e52f8
3 changed files with 76 additions and 5 deletions

View File

@@ -26,6 +26,7 @@ EXCHANGE_NAME = os.environ.get("RABBITMQ_EXCHANGE", "vstu_schedule")
INFINITY_LOOP = os.environ.get("INFINITY_LOOP", "no").lower() in ['yes', "true"]
parser.LOGGING = LOGGING = os.environ.get("PARSER_LOGGING", "no").lower() in ['yes', "true"]
try:
connection = pika.BlockingConnection(pika.URLParameters(RABBITMQ_URL))
channel = connection.channel()
@@ -48,6 +49,7 @@ PARSED_DIR = "parsed"
DEBUG_ONE_FAC = None #'fevt'
DEBUG_NO_SAVE_STATES = False
DEBUG_NO_LINKS_DELAY = True
def parse_sheets(download_place):
to_return = {}
@@ -168,7 +170,7 @@ def run_session():
print("main(); parse links starting...")
EXCEL_LINKS = links_parser.parse_links(FACULTETS if DEBUG_ONE_FAC is None else [DEBUG_ONE_FAC])
EXCEL_LINKS = links_parser.parse_links(FACULTETS if DEBUG_ONE_FAC is None else [DEBUG_ONE_FAC], DEBUG_NO_LINKS_DELAY=DEBUG_NO_LINKS_DELAY)
if len(EXCEL_LINKS) < 5 and not DEBUG_ONE_FAC:
raise Exception("Safety exception: excel links count < 5; maybe in vstu.ru tech works")