latestClosedBucket returns the newest bucket_start that is fully closed: every contribution for it has landed (grace exceeds the in-process flush interval), so it is safe to serve — and later delete on ack.
()
| 39 | // storage-holding org per day, several per compute-active org) and the |
| 40 | // repetitive JSON compresses well. Negotiated per request — clients that |
| 41 | // don't send Accept-Encoding: gzip get plain JSON. |
| 42 | r.GET("/billing/usage", requireAdmin, gingzip.Gzip(gingzip.DefaultCompression), h.getUsage) |
| 43 | r.POST("/billing/ack", requireAdmin, h.postAck) |
| 44 | } |
| 45 | |
| 46 | // latestClosedBucket returns the newest bucket_start that is fully closed: |