Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 371483b

Browse files
committed
Go back to using full objects when removing
1 parent cb937dc commit 371483b

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

src/GitHub.App/Extensions/AkavacheExtensions.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public static IObservable<T> GetAndFetchLatestFromIndex<T>(
166166
this IBlobCache blobCache,
167167
string key,
168168
Func<IObservable<T>> fetchFunc,
169-
Action<string> removedItemsCallback,
169+
Action<T> removedItemsCallback,
170170
TimeSpan refreshInterval,
171171
TimeSpan maxCacheDuration)
172172
where T : CacheItem
@@ -194,7 +194,7 @@ public static IObservable<T> GetAndFetchLatestFromIndex<T>(
194194
static IObservable<T> GetAndFetchLatestFromIndex<T>(this IBlobCache This,
195195
string key,
196196
Func<IObservable<T>> fetchFunc,
197-
Action<string> removedItemsCallback,
197+
Action<T> removedItemsCallback,
198198
Func<DateTimeOffset, bool> fetchPredicate = null,
199199
DateTimeOffset? absoluteExpiration = null,
200200
bool shouldInvalidateOnError = false)
@@ -237,7 +237,8 @@ static IObservable<T> GetAndFetchLatestFromIndex<T>(this IBlobCache This,
237237
var list = index.OldKeys.Except(index.Keys);
238238
if (!list.Any())
239239
return;
240-
foreach (var d in list)
240+
var removed = await This.GetObjects<T>(list);
241+
foreach (var d in removed.Values)
241242
removedItemsCallback(d);
242243
await This.InvalidateObjects<T>(list);
243244
})

src/GitHub.App/Models/PullRequestModel.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ public PullRequestModel(int number, string title,
2323
UpdatedAt = updatedAt ?? CreatedAt;
2424
}
2525

26-
internal PullRequestModel(int number)
27-
{
28-
Number = number;
29-
Title = "";
30-
Author = new AccountDesigner();
31-
}
32-
3326
public void CopyFrom(IPullRequestModel other)
3427
{
3528
if (!Equals(other))

src/GitHub.App/Services/ModelService.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,6 @@ IPullRequestModel Create(PullRequestCacheItem prCacheItem)
273273
};
274274
}
275275

276-
static IPullRequestModel Create(string key)
277-
{
278-
return new PullRequestModel(Int32.Parse(key.Split('|').Last(), CultureInfo.InvariantCulture));
279-
}
280276

281277
public IObservable<Unit> InsertUser(AccountCacheItem user)
282278
{

0 commit comments

Comments
 (0)