Skip to content

Commit

Permalink
Add default state setup
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMcPMS committed Sep 26, 2023
1 parent da93070 commit 937f944
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ namespace winrt::Microsoft::Management::Deployment::implementation

if (IsBackgroundProcessForPolicy())
{
// Delay the default update interval for these background processes
static constexpr winrt::Windows::Foundation::TimeSpan s_PackageCatalogUpdateIntervalDelay_Base = 168h; //1 week

// Add a bit of randomness to the default interval time
std::default_random_engine randomEngine(std::random_device{}());
std::uniform_int_distribution<long long> distribution(0, 604800);

m_packageCatalogBackgroundUpdateInterval = s_PackageCatalogUpdateIntervalDelay_Base + std::chrono::seconds(distribution(randomEngine));

// Prevent any update / data processing by default for these background processes
m_installedPackageInformationOnly = true;
}
}
void PackageCatalogReference::Initialize(winrt::Microsoft::Management::Deployment::CreateCompositePackageCatalogOptions options)
Expand Down

0 comments on commit 937f944

Please sign in to comment.