MCPcopy Create free account
hub / github.com/Snapchat/Valdi / store

Method store

valdi/src/valdi/runtime/Resources/KeyValueStore.cpp:42–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40KeyValueStore::~KeyValueStore() = default;
41
42void KeyValueStore::store(const StringBox& key, const BytesView& blob, uint64_t ttlSeconds, uint64_t weight) {
43 uint64_t expirationDateSeconds = 0;
44 if (ttlSeconds != 0) {
45 expirationDateSeconds = currentTimeSeconds() + ttlSeconds;
46 }
47
48 _entries[key] = KeyValueStoreEntry(++_mutationId, expirationDateSeconds, weight, blob);
49}
50
51std::optional<BytesView> KeyValueStore::fetch(const StringBox& key, bool updateSequence) {
52 auto it = _entries.find(key);

Callers

nothing calls this directly

Calls 1

KeyValueStoreEntryClass · 0.85

Tested by

no test coverage detected