this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

--persist-hours

+9 -2
+7 -1
cmd/rainbow/main.go
··· 66 66 Value: ":2481", 67 67 EnvVars: []string{"SPLITTER_METRICS_LISTEN"}, 68 68 }, 69 + &cli.Float64Flag{ 70 + Name: "persist-hours", 71 + Value: 24 * 7, 72 + EnvVars: []string{"SPLITTER_PERSIST_HOURS"}, 73 + Usage: "hours to buffer (float, may be fractional)", 74 + }, 69 75 } 70 76 71 77 app.Action = Splitter ··· 121 127 var err error 122 128 if persistPath != "" { 123 129 log.Infof("building splitter with storage at: %s", persistPath) 124 - spl, err = splitter.NewDiskSplitter(upstreamHost, persistPath) 130 + spl, err = splitter.NewDiskSplitter(upstreamHost, persistPath, cctx.Float64("persist-hours")) 125 131 if err != nil { 126 132 log.Fatalw("failed to create splitter", "path", persistPath, "error", err) 127 133 return err
+2 -1
splitter/splitter.go
··· 54 54 consumers: make(map[uint64]*SocketConsumer), 55 55 } 56 56 } 57 - func NewDiskSplitter(host, path string) (*Splitter, error) { 57 + func NewDiskSplitter(host, path string, persistHours float64) (*Splitter, error) { 58 58 pp, err := events.NewPebblePersistance(path) 59 59 if err != nil { 60 60 return nil, err 61 61 } 62 62 63 + go pp.GCThread(context.Background(), time.Duration(float64(time.Hour)*persistHours), 5*time.Minute) 63 64 em := events.NewEventManager(pp) 64 65 return &Splitter{ 65 66 cursorFile: "cursor-file",