fix: move calendar_sync_utils to services/ and remove sys.path.insert hacks from all calendar sync steps
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user