Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

Work out change statuses for the page, not the whole queue

e54a7eb1d764179b6c82afb5343982201ae23a9e · Keenan Nemetz · 5d ago · parent 7cc36ba0

Work out change statuses for the page, not the whole queue

A row that would read as ready is checked against its base with one merge, and
that work was happening for every request the filter matched, before the pager
cut the list down. A repository with hundreds of changes paid for rows nobody
was looking at. The decoration now runs on the page slice, so the cost is
bounded by what the reader sees.

server/web/requests.go +4−2

@@ -129,6 +129,10 @@ func (w *Web) Requests(rw http.ResponseWriter, r *http.Request) {
129 129 }).forSwap("Change pages", "#change-list")
130 130 from, to := pg.rows()
131 131 rows = rows[from:to]
132 // Status is worked out for the page, not for everything the filter matched:
133 // a ready row costs a merge, and a repository with hundreds of changes should
134 // not pay for the ones nobody is looking at.
135 w.decorateChangeStatuses(m, rows)
132 136 form := w.requestForm(r, m)
133 137
134 138 acl, _ := m.ACL()
@@ -221,7 +225,6 @@ func (w *Web) requestList(r *http.Request, m *repo.Meta, state, query string) ([
221 225 }
222 226 return rows[i].ID > rows[j].ID
223 227 })
224 w.decorateChangeStatuses(m, rows)
225 228 return rows, counts, nil
226 229 }
227 230
@@ -265,7 +268,6 @@ func (w *Web) requestList(r *http.Request, m *repo.Meta, state, query string) ([
265 268 Current: current, Required: required,
266 269 })
267 270 }
268 w.decorateChangeStatuses(m, rows)
269 271 return rows, counts, nil
270 272 }
271 273