""" Application constants """ from __future__ import annotations from enum import Enum APP_NAME: str = "apollo-playlist-sync" ENV_PROD: str = "prod" ENV_DEV: str = "development" ENV_LOCAL: str = "local" ENV_TEST: str = "test" DEBUG_ENVS = (ENV_LOCAL, ENV_DEV) DISABLE_AUTH_URLS: tuple[str, ...] = ( "/health", "/doc", "/_serviceaccounts/apple_music_tmp", "/_serviceaccounts/callback" ) class AppExecutionTypes: """Lambda instance execution types. The lambda could be executed in 3 different ways: 1. MAIN - the main lambda instance, which handle different input events: a) various http requests, in case of getting request to sync user playlists, creates and sends to sqs corresponding event, that will be handled by USER_PLAYLISTS_SYNC lambda instance(s), b) warmup event - just invoke lambda to warmup it, c) schedule event - schedule background run: lambda creates and sends to sqs corresponding events, that will be handled by BACKGROUND lambda instance(s). 2. USER_PLAYLISTS_SYNC - lambda instances that consumes warmup events - directly and scheduled playlists-sync events - from sqs, for that it run sync process. One event for one sync. 3. BACKGROUND_PLAYLISTS_SYNC - lambda instances that consumes warmup events - directly and scheduled playlists-sync events - from sqs, for that it run sync process. One event for multiple syncs. USER_PLAYLISTS_SYNC and BACKGROUND_PLAYLISTS_SYNC lambda instances are the same in terms of logic, but they are being run with different configuration (timeout, concurrency). """ MAIN = "main" USER_PLAYLISTS_SYNC = "user" BACKGROUND_PLAYLISTS_SYNC = "schedule" class MainInvocationTypes(Enum): WARMUP = "WARMUP" API = "API" SCHEDULE_SYNC = "SCHEDULE" ALL = (WARMUP, API, SCHEDULE_SYNC)