Skip to content

Commit b0b223e

Browse files
committed
[SharedCache] Fix older BNDBs not updating workflow to use new workflow name
1 parent 538565e commit b0b223e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

view/sharedcache/core/SharedCacheView.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,16 @@ bool SharedCacheView::Init()
218218

219219
Ref<Settings> settings = GetLoadSettings(GetTypeName());
220220

221-
// If we are a new file (not a database) lets go ahead and set the function workflow.
222-
// We do not set the workflow on database as the user might have changed it in load options prior.
223-
if (!settings && !GetFile()->IsBackedByDatabase())
221+
if (!settings)
224222
{
225223
Ref<Settings> programSettings = Settings::Instance();
226-
programSettings->Set("analysis.workflows.functionWorkflow", "core.function.sharedCache", this);
224+
auto previousWorkflow = programSettings->Get<std::string>("analysis.workflows.functionWorkflow", this);
225+
226+
// If we are a new file (not a database) lets go ahead and set the function workflow.
227+
// We do not set the workflow on database as the user might have changed it in load options prior.
228+
// We also need to update usages of `core.function.dsc` to `core.function.sharedCache`
229+
if (!GetFile()->IsBackedByDatabase() || previousWorkflow == "core.function.dsc")
230+
programSettings->Set("analysis.workflows.functionWorkflow", "core.function.sharedCache", this);
227231
}
228232

229233
if (m_parseOnly)

0 commit comments

Comments
 (0)