Throttle external license DB sync to remove pressure during initial sync

Problem to solve

Our QA pipelines caught excessive pressure on the DB during the initial sync of the package metadata.

Proposal

Several mitigations have been discussed in #397670 (closed).

This issue is intended to resolve the immediate need by throttling the rate of inserts into the DB.

Throttle rate

The reasoning behind the throttle rate is discussed here: !115581 (merged)

Implementation Plan

  • add a sleep using a throttle rate constant after each ingestion call to PackageMetadata::SyncService
Edited by Igor Frenkel