commit 7b6f58ac20aeaa61444bf4abeb05326ac2b33455
parent cec3820ea2db1d3078b0f240d9fe4209bd76d22b
Author: JohnMcPMS <johnmcp@microsoft.com>
Date: Tue, 16 May 2023 10:12:32 -0700
Fix stuff (#3254)
Disable dependency indexing for the installing database, and on a failure to index the manifest, remove the item from the queue.
Diffstat:
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/AppInstallerCLICore/ContextOrchestrator.cpp b/src/AppInstallerCLICore/ContextOrchestrator.cpp
@@ -174,7 +174,20 @@ namespace AppInstaller::CLI::Execution
// Only do this the first time the item is queued.
if (item->IsOnFirstCommand())
{
- ContextOrchestrator::Instance().AddItemManifestToInstallingSource(*item);
+ try
+ {
+ ContextOrchestrator::Instance().AddItemManifestToInstallingSource(*item);
+ }
+ catch (...)
+ {
+ std::lock_guard<std::mutex> lockQueue{ m_queueLock };
+ auto itr = FindIteratorById(item->GetId());
+ if (itr != m_queueItems.end())
+ {
+ m_queueItems.erase(itr);
+ }
+ throw;
+ }
}
{
diff --git a/src/AppInstallerRepositoryCore/Microsoft/PredefinedWriteableSourceFactory.cpp b/src/AppInstallerRepositoryCore/Microsoft/PredefinedWriteableSourceFactory.cpp
@@ -60,8 +60,8 @@ namespace AppInstaller::Repository::Microsoft
std::call_once(g_InstallingSourceOnceFlag,
[&]()
{
- // Create an in memory index
- SQLiteIndex index = SQLiteIndex::CreateNew(SQLITE_MEMORY_DB_CONNECTION_TARGET, Schema::Version::Latest());
+ // Create an in memory index without paths or dependencies
+ SQLiteIndex index = SQLiteIndex::CreateNew(SQLITE_MEMORY_DB_CONNECTION_TARGET, Schema::Version::Latest(), SQLiteIndex::CreateOptions::SupportPathless | SQLiteIndex::CreateOptions::DisableDependenciesSupport);
g_sharedSource = std::make_shared<SQLiteIndexWriteableSource>(m_details, std::move(index), Synchronization::CrossProcessReaderWriteLock{}, true);
});