You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use Etebase's Local Cache to recreate the Etesync 1.0 sync functionality where the local cache could be updated with only changed items.
My plan is as follows:
At end of day
Use item_mgr.cache_save(item) to save the item to cache. Presumably, I would have to put this in a loop (for item in items:) to save all items to local storage.
Also store items.stoken to local storage.
Come back next day
Run a item_mgr.cache_load(cache_blob) loop to load all items.
Fetch new items with items = item_mgr.list(FetchOptions().stoken(stoken))
What I do not understand is how to merge the cache and the new/updated items. One possibility is to convert items into a python dict with uid as key and do something like updated_items_dict = cached_items_dict.update(new_items_dict)
Would appreciate any help on how to go about doing this.
Also the python source code contains a function cache_save_with_content. Is this of any use in this context? I can understand python code but not rust
The text was updated successfully, but these errors were encountered:
I am trying to use Etebase's Local Cache to recreate the Etesync 1.0
sync
functionality where the local cache could be updated with only changed items.My plan is as follows:
At end of day
item_mgr.cache_save(item)
to save the item to cache. Presumably, I would have to put this in a loop (for item in items:
) to save all items to local storage.items.stoken
to local storage.Come back next day
item_mgr.cache_load(cache_blob)
loop to load all items.items = item_mgr.list(FetchOptions().stoken(stoken))
What I do not understand is how to merge the cache and the new/updated items. One possibility is to convert
items
into a python dict withuid
as key and do something likeupdated_items_dict = cached_items_dict.update(new_items_dict)
Would appreciate any help on how to go about doing this.
Also the python source code contains a function
cache_save_with_content
. Is this of any use in this context? I can understandpython
code but notrust
The text was updated successfully, but these errors were encountered: