carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package console
2
3// claim_geoip.go is the claim runtime's half of GeoIP. newGeoipPublisher keeps
4// the Releases handle it is given, and NewServer gives it the raw bucket, so
5// without a rebind every publish, off, sweep, expiry and feed-status write
6// would reach the bucket past the mutation boundary.
7
8// rebindGeoipStore points the publisher (and so the feed, which reads its
9// store from the publisher) at the Releases handle now in s.cfg. It is called
10// by ConfigureClaimRuntime right after s.cfg.Releases becomes the boundary and
11// before any handler or worker can run, so nothing holds the publish slot.
12func (s *Server) rebindGeoipStore() {
13 if s.geoip == nil {
14 return
15 }
16 s.geoip.mu.Lock()
17 defer s.geoip.mu.Unlock()
18 s.geoip.store = s.cfg.Releases
19}
20