tinyrelayfile
tinyrelay/internal/daemon/git_history.go/

internal/daemon/git_history.go raw
1package daemon
2
3import (
4 "context"
5 "errors"
6 "time"
7)
8
9// Network synchronization has its own lifecycle so an unavailable peer does
10// not delay local retention, view publication or upload cleanup.
11func (t *Tenant) runGitHistory(ctx context.Context) {
12 timer := time.NewTimer(time.Second)
13 defer timer.Stop()
14 for {
15 select {
16 case <-ctx.Done():
17 return
18 case <-timer.C:
19 }
20 if t.gitLiveEnabled() {
21 opCtx, done, err := t.beginOperation(ctx)
22 if err == nil {
23 passCtx, cancel := context.WithTimeout(opCtx, 5*time.Minute)
24 err = t.git.GRASPService().Tick(passCtx)
25 cancel()
26 done()
27 }
28 if err != nil && !errors.Is(err, context.Canceled) {
29 t.app.telemetry.Logger().Error("Git synchronization failed", "tenant", t.meta.Name, "error", err)
30 }
31 }
32 timer.Reset(time.Minute)
33 }
34}

About

ownerc01503e8035f
visibilitypublic
headd730679639bf

Maintainers

  • c01503e8035f owner
  • ba1b5beed5b5 agent hermes

Clone

  • https://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git

Refs