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/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

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

Code

392 commit(s) on main

Merge change request 01M70WES5ZZDJ6RP226WB11BBZ: Let people rename and remove their own passkeys keenan · 25m ago 4b8c9e1d
history blame raw 857 B
1package server
2
3// The instance repository is reloaded on a short timer, the same trade the pages
4// server makes for a site tip: a push is live within a couple of seconds, and a
5// request never runs git. A load error keeps the previous snapshot; the warning
6// is repeated only when the error changes, so a missing repository does not fill
7// the log.
8
9import (
10 "context"
11 "time"
12)
13
14const instanceRepoReload = 2 * time.Second
15
16func (s *Server) watchInstanceRepo(ctx context.Context) {
17 t := time.NewTicker(instanceRepoReload)
18 defer t.Stop()
19 last := ""
20 for {
21 select {
22 case <-ctx.Done():
23 return
24 case <-t.C:
25 err := s.InstanceRepo.Reload()
26 switch {
27 case err == nil:
28 last = ""
29 case err.Error() != last:
30 s.Log.Warn("instance repository: cannot load", "repo", s.Cfg.InstanceRepo, "err", err)
31 last = err.Error()
32 }
33 }
34 }
35}
36