Explorer

definy.read-snapshot-summary-list

description
The light summaries of the accepted project snapshots (definy.snapshot-cache-entry-summary: no parts) in the order of the store (newest first). They are cached apart from the full snapshots, so reading them does not read every part of every snapshot. A summary that is not cached yet is read directly from the event (definy.write-snapshot-summaries, definy.decode-stored-snapshot-summary) without the full snapshot, and written 50 at a time
type
Fn(then: Fn(commits: List<@definy.event-snapshot>) -> @definy.service-io) -> @definy.service-io
expression
fn(then$0) =>
  @definy.read-snapshot-events(
    offset: 0,
    acc: [],
    then: fn(events$1) =>
      #read_cached_commits<@definy.service-io>({
        version: @definy.snapshot-cache-version,
        event_hashes: @core.list-map(
          T: @definy.stored-event,
          U: String,
          f: fn(item$2) =>
            @definy.snapshot-summary-key(event_hash: $2.event_hash),
          xs: $1
        ),
        then: fn(cached$3) =>
          @definy.write-snapshot-summaries(
            event_hashes: @definy.snapshot-summaries-missing(events: $1, cached: $3),
            index: 0,
            written: [],
            then: fn(written$4) =>
              $0(
                commits: @definy.summary-snapshots-of(events: $1, entries: @core.list-concat(left: $3, right: $4))
              )
          )
      })
  )
visibility
public
definy.read-snapshot-summary-list (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: Yaa4tVO7aG6Zm_7VNwyC1jP2bCSk2bELa6UOQ1e_urk
content hash: 8675GS6mJOLKtQof1dXZGDOddGQm9A_upgNm0KFv3NQ