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

Method doSave

valdi/src/valdi/runtime/JavaScript/Modules/PersistentStore.cpp:162–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void PersistentStore::doSave() {
163 Result<Void> result;
164 auto serializeResult = _store.serialize();
165
166 if (serializeResult) {
167 result = _activeDiskCache->store(_diskCachePath, serializeResult.value());
168 } else {
169 result = serializeResult.moveError();
170 }
171
172 auto pendingSaves = std::move(_pendingSaves);
173 for (const auto& pendingSave : pendingSaves) {
174 pendingSave(result);
175 }
176}
177
178void PersistentStore::populate() {
179 _dispatchQueue->async([self = strongRef(this)]() { self->doPopulate(); });

Callers 1

scheduleSaveMethod · 0.95

Calls 3

storeMethod · 0.65
valueMethod · 0.65
serializeMethod · 0.45

Tested by

no test coverage detected