fix: move calendar_sync_utils to services/ and remove sys.path.insert hacks from all calendar sync steps

This commit is contained in:
bsiggel
2026-03-31 07:08:21 +00:00
parent cc70189513
commit e1695e530a
5 changed files with 136 additions and 16 deletions

View File

@@ -4,10 +4,7 @@ Calendar Sync All Step
Handles calendar_sync_all event and emits individual sync events for oldest employees.
Uses Redis to track last sync times and distribute work.
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
from calendar_sync_utils import (
from services.calendar_sync_utils import (
get_redis_client,
get_advoware_employees,
set_employee_lock,

View File

@@ -4,10 +4,7 @@ Calendar Sync API Step
HTTP API endpoint for manual calendar sync triggering.
Supports syncing a single employee or all employees.
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
from calendar_sync_utils import get_redis_client, set_employee_lock, get_logger
from services.calendar_sync_utils import get_redis_client, set_employee_lock
from motia import http, ApiRequest, ApiResponse, FlowContext

View File

@@ -4,10 +4,6 @@ Calendar Sync Cron Step
Cron trigger for automatic calendar synchronization.
Emits calendar_sync_all event to start sync cascade.
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
from calendar_sync_utils import log_operation
from typing import Dict, Any
from motia import cron, FlowContext

View File

@@ -24,10 +24,7 @@ from googleapiclient.errors import HttpError
from google.oauth2 import service_account
import redis
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
from calendar_sync_utils import (
from services.calendar_sync_utils import (
connect_db,
get_google_service,
log_operation,