def heart_beat_on_topics() -> None: topics = CacheService.topic().all() topic_service = TopicService(ask_meta_storage(), ask_snowflake_generator(), ask_super_admin()) topic_service.begin_transaction() try: for topic in topics: loaded: Optional[Topic] = topic_service.find_by_id(topic.topicId) if loaded is None: CacheService.topic().remove(topic.topicId) elif loaded.lastModifiedAt > topic.lastModifiedAt or loaded.version > topic.version: CacheService.topic().put(loaded) finally: topic_service.close_transaction()
def get_topic_service(principal_service: PrincipalService) -> TopicService: return TopicService(ask_meta_storage(), ask_snowflake_generator(), principal_service)
def get_topic_service(tenant_service: MetaTenantService) -> TopicService: return TopicService(tenant_service.storage, tenant_service.snowflakeGenerator, tenant_service.principalService)
def get_topic_service(user_service: UserService) -> TopicService: return TopicService(user_service.storage, user_service.snowflakeGenerator, user_service.principalService)
def get_topic_service(space_service: SpaceService) -> TopicService: return TopicService(space_service.storage, space_service.snowflakeGenerator, space_service.principalService)
def get_topic_service(catalog_service: CatalogService) -> TopicService: return TopicService(catalog_service.storage, catalog_service.snowflakeGenerator, catalog_service.principalService)
def get_topic_service(enum_service: EnumService) -> TopicService: return TopicService(enum_service.storage, enum_service.snowflakeGenerator, enum_service.principalService)
def get_topic_service(subject_service: SubjectService) -> TopicService: return TopicService(subject_service.storage, subject_service.snowflakeGenerator, subject_service.principalService)
def get_topic_service( scheduler_service: TopicSnapshotSchedulerService) -> TopicService: return TopicService(scheduler_service.storage, scheduler_service.snowflakeGenerator, scheduler_service.principalService)