mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Fix circular import in gitlab_sync.py (#12334)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import asyncio
|
||||
|
||||
from integrations.gitlab.gitlab_service import SaaSGitLabService
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
@@ -19,6 +18,12 @@ def schedule_gitlab_repo_sync(
|
||||
|
||||
async def _run():
|
||||
try:
|
||||
# Lazy import to avoid circular dependency:
|
||||
# middleware -> gitlab_sync -> integrations.gitlab.gitlab_service
|
||||
# -> openhands.integrations.gitlab.gitlab_service -> get_impl
|
||||
# -> integrations.gitlab.gitlab_service (circular)
|
||||
from integrations.gitlab.gitlab_service import SaaSGitLabService
|
||||
|
||||
service = SaaSGitLabService(
|
||||
external_auth_id=user_id, external_auth_token=keycloak_access_token
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user