lizerk f15e8aca3f feat(ldap): add LDAP sync retry queue with Celery
- Add LdapSyncQueue model for deferred LDAP operations
- Add Celery tasks: process_ldap_queue_item, process_ldap_queue
- Refactor all LDAP signals (employee, department, group, position)
  to enqueue operations on DirectoryLdapError/DirectoryServiceError
- Add _queue.py helper for enqueuing with automatic Celery dispatch
- Add Celery Beat periodic task (every 60s) for queue processing
- Add management command: ldap_queue (status/retry/cleanup)
- Add migration 0043_ldap_sync_queue
- Add 18 tests covering model, tasks, signals, and enqueue logic
- Include LDAP services refactoring (base_service, constants,
  user_login_service, user_mapper_service, user_password_service,
  phone_utils)
2026-03-19 15:07:34 +03:00

19 lines
635 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class DirectoryServiceError(Exception):
"""Базовая ошибка сервисного слоя."""
class DirectoryLdapError(DirectoryServiceError):
"""Ошибка на стороне LDAP."""
class DirectoryConnectionError(DirectoryLdapError):
"""Ошибка подключения к LDAP-серверу (конфигурация, сеть, аутентификация)."""
class DirectoryDbError(DirectoryServiceError):
"""Ошибка фиксации изменений в БД."""
class DirectoryGroupError(DirectoryServiceError):
"""Ошибка операций с LDAP-группами."""