sdk: replace replaceables instead of saving.
This commit is contained in:
+1
-1
@@ -94,7 +94,7 @@ func fetchGenericList[V comparable, I TagItemWithValue[V]](
|
|||||||
// we'll only save this if we got something which means we found at least one event
|
// we'll only save this if we got something which means we found at least one event
|
||||||
lastFetchKey := makeLastFetchKey(actualKind, pubkey)
|
lastFetchKey := makeLastFetchKey(actualKind, pubkey)
|
||||||
sys.KVStore.Set(lastFetchKey, encodeTimestamp(nostr.Now()))
|
sys.KVStore.Set(lastFetchKey, encodeTimestamp(nostr.Now()))
|
||||||
sys.Store.SaveEvent(*v.Event)
|
sys.Store.ReplaceEvent(*v.Event)
|
||||||
}
|
}
|
||||||
|
|
||||||
// save cache even if we didn't get anything
|
// save cache even if we didn't get anything
|
||||||
|
|||||||
+1
-1
@@ -142,7 +142,7 @@ func (sys *System) FetchProfileMetadata(ctx context.Context, pubkey nostr.PubKey
|
|||||||
if newM := sys.tryFetchMetadataFromNetwork(ctx, pubkey); newM != nil {
|
if newM := sys.tryFetchMetadataFromNetwork(ctx, pubkey); newM != nil {
|
||||||
pm = *newM
|
pm = *newM
|
||||||
|
|
||||||
sys.Store.SaveEvent(*pm.Event)
|
sys.Store.ReplaceEvent(*pm.Event)
|
||||||
|
|
||||||
// we'll only save this if we got something which means we found at least one event
|
// we'll only save this if we got something which means we found at least one event
|
||||||
lastFetchKey := makeLastFetchKey(0, pubkey)
|
lastFetchKey := makeLastFetchKey(0, pubkey)
|
||||||
|
|||||||
Reference in New Issue
Block a user