From 1821d86a1e87a664fb71d86c4d4d339a8ac9cbd7 Mon Sep 17 00:00:00 2001 From: Rufei Zhou Date: Thu, 10 Apr 2025 05:15:34 -0700 Subject: [PATCH] put some temp sleeps in there --- src/events_plus/scrapers/sakuracon.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/events_plus/scrapers/sakuracon.py b/src/events_plus/scrapers/sakuracon.py index 22a1408..ff4271d 100755 --- a/src/events_plus/scrapers/sakuracon.py +++ b/src/events_plus/scrapers/sakuracon.py @@ -7,6 +7,7 @@ import aiohttp import json import os import base64 +import time from google.oauth2 import service_account from googleapiclient.discovery import build @@ -16,7 +17,7 @@ from googleapiclient.errors import HttpError EVENTNY_ENDPOINT = "https://www.eventeny.com/funcs/event/event-page-elements-2022-03-06.php" SAK_BIZ_ID = "233997" SAK_EVENT_ID = "13462" -BATCH_LIMIT = 500 +BATCH_LIMIT = 190 async def clear_sakuracon_events(config_path="config/sakuracon.json"): with open(config_path) as f: @@ -266,11 +267,15 @@ def update_gcal(scraped_events, tracks, cfg): batch.execute() batchlen = 0 batch = service.new_batch_http_request() + print("batch zzz") + time.sleep(60) except HttpError as error: print(f"An error occurred: {error}") print(gcal_body) batch.execute() batchlen = 0 + print("batch zzz") + time.sleep(60) # delete all gcal_events which are not in the events array # we have the list of gcal events