Skip to content

Commit

Permalink
Fix stuff (#3254)
Browse files Browse the repository at this point in the history
Disable dependency indexing for the installing database, and on a failure to index the manifest, remove the item from the queue.
  • Loading branch information
JohnMcPMS authored May 16, 2023
1 parent cec3820 commit 7b6f58a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion src/AppInstallerCLICore/ContextOrchestrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 7b6f58a

Please sign in to comment.