synology_apm_repo.sdk.units.saas.context module

SharedSaasContext: what every candidate provider for one SaaS version shares — its saas_obj, object-name index and the index’s reference-counted ObjectDB.

class synology_apm_repo.sdk.units.saas.context.SharedIndexObjectDb(dedup_file, object_name_index)

Bases: object

One version’s object-name-index ObjectDB, reference-counted: loaded on the first acquire(), closed once every holder has called release().

async acquire()
async release()
class synology_apm_repo.sdk.units.saas.context.SharedSaasContext(dedup_file, object_name_index, index_object_db)

Bases: object

One SaaS version’s stream object and object-name index, resolved once by resolve_shared_saas_context: units/dispatch.py passes it to every candidate provider (M365’s USER_EXCHANGE tries four) and to the RawObjectProvider fallback as shared, and a provider built on its own resolves one the same way.

index_object_db loads the index’s ObjectDB once between them; each provider takes a hold and releases it when it closes. The other fields need no closing.

dedup_file: DedupFile
object_name_index: ObjectNameIndex | None
index_object_db: SharedIndexObjectDb | None
async synology_apm_repo.sdk.units.saas.context.resolve_shared_saas_context(repo, version, saas_streams)

Resolve the SharedSaasContext for version. saas_streams is borrowed: the SaasStream it opens stays cached there.