Skip to main content

fetch_wanted

Function fetch_wanted 

Source
pub fn fetch_wanted(
    memory: &Path,
    folder: &Path,
    login: &Login,
    key: &[u8; 32],
    now: i64,
    frugal: bool,
) -> Pulled
Expand description

The sealed files of the others’ notes and papers this device waits for (blobs::Wanted: their records came, the files they name did not), fetched from the folder’s server by their names, beside the synced folder (overlay’s blobs/, read by blobs::get), when the backup is found there under the same seal (docs/database.md, “Sealed files fetched when waited for”). Only those neither in the folder nor fetched yet, the smallest first, at most WANTED_FILES and WANTED_BYTES a step (the first whatever its size). On a metered or slow connection (frugal), the pace of what is sent (send): one of SMALL_WANTED or more at most every ten minutes, a note’s at once. Each kept only once it opens whole to its content (blobs::check): one that does not is asked again after a while (backoff, up to an hour); one not on the server yet, within five minutes. No listing of the server’s blobs/: the records name them. Never on the window’s thread; one fetch at a time on this device.