Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled in-memory caching of rest responses #455

Merged
merged 2 commits into from
May 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public Uri CreateServiceInsightUri(StoredMessage message)
return new Uri(string.Format("si://{0}/api{1}", Address, message.GetURIQuery()));
}

public bool HasSagaChanged(Guid sagaId)
{
return true;
}

public SagaData GetSagaById(Guid sagaId)
{
return new SagaData();
Expand Down Expand Up @@ -82,7 +77,7 @@ public IEnumerable<Endpoint> GetEndpoints()
return Get<List<Endpoint>>("GetEndpoints");
}

public IEnumerable<KeyValuePair<string, string>> GetMessageData(Guid messageId)
public IEnumerable<KeyValuePair<string, string>> GetMessageData(SagaMessage messageId)
{
return new List<KeyValuePair<string, string>>();
}
Expand Down
1 change: 1 addition & 0 deletions src/ServiceInsight.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ II.2.12 &lt;HandlesEvent /&gt;&#xD;
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=TypeParameters/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpFileLayoutPatternsUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsCodeFormatterSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
Expand Down
7 changes: 5 additions & 2 deletions src/ServiceInsight/Saga/SagaMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ public bool ShowData

internal void RefreshData(IServiceControl serviceControl)
{
if (Data != null) return;
if (Data != null)
{
return;
}

Data = serviceControl.GetMessageData(MessageId).Select(kvp => new SagaMessageDataItem { Key = kvp.Key, Value = kvp.Value }).ToList();
Data = serviceControl.GetMessageData(this).Select(kvp => new SagaMessageDataItem { Key = kvp.Key, Value = kvp.Value }).ToList();
}
}

Expand Down
11 changes: 4 additions & 7 deletions src/ServiceInsight/Saga/SagaWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ void RefreshMessageProperties(IEnumerable<SagaMessage> messages)
public void Handle(SelectedMessageChanged @event)
{
var message = @event.Message;
RefreshSaga(message, a => true);
RefreshSaga(message);
}

void RefreshSaga(StoredMessage message, Func<Guid, bool> HasChanged)
void RefreshSaga(StoredMessage message)
{
currentMessage = message;
ShowSagaNotFoundWarning = false;
Expand All @@ -91,10 +91,7 @@ void RefreshSaga(StoredMessage message, Func<Guid, bool> HasChanged)

if (originatingSaga != null)
{
if (HasChanged(originatingSaga.SagaId))
{
RefreshSaga(originatingSaga);
}
RefreshSaga(originatingSaga);
}
}
}
Expand Down Expand Up @@ -184,7 +181,7 @@ public void ShowFlow()

public void RefreshSaga()
{
RefreshSaga(currentMessage, serviceControl.HasSagaChanged);
RefreshSaga(currentMessage);
}

public SagaMessage SelectedMessage
Expand Down
Loading