From dcb2dba50f0d6280dca23220896e82e212860dae Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Oct 2025 19:58:18 +0000 Subject: [PATCH] =?UTF-8?q?API-Schutz:=20100ms=20Verz=C3=B6gerung=20bei=20?= =?UTF-8?q?allen=20Google=20API=20Calls=20(create,=20update,=20delete)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py b/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py index 28ad1fe7..e1ebbef3 100644 --- a/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py +++ b/bitbylaw/steps/advoware_cal_sync/calendar_sync_event_step.py @@ -480,6 +480,7 @@ async def create_google_event(service, calendar_id, data, context=None): created = service.events().insert(calendarId=calendar_id, body=event_body).execute() event_id = created['id'] log_operation('info', f"Created Google event ID: {event_id}", context=context) + await asyncio.sleep(0.1) # Rate limit protection: 100ms delay after each Google API call return event_id except HttpError as e: log_operation('error', f"Google API error creating event: {e}", context=context) @@ -513,6 +514,7 @@ async def update_google_event(service, calendar_id, event_id, data, context=None try: service.events().update(calendarId=calendar_id, eventId=event_id, body=event_body).execute() log_operation('info', f"Updated Google event ID: {event_id}", context=context) + await asyncio.sleep(0.1) # Rate limit protection: 100ms delay after each Google API call except HttpError as e: log_operation('error', f"Google API error updating event {event_id}: {e}", context=context) raise @@ -526,6 +528,7 @@ async def delete_google_event(service, calendar_id, event_id, context=None): try: service.events().delete(calendarId=calendar_id, eventId=event_id).execute() log_operation('info', f"Deleted Google event ID: {event_id}", context=context) + await asyncio.sleep(0.1) # Rate limit protection: 100ms delay after each Google API call except HttpError as e: log_operation('error', f"Google API error deleting event {event_id}: {e}", context=context) raise