Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9d4a03

Browse files
committed
Switch activitylog servie to a native nats store
Also split the list of activities in different chunks, one per buffered write. That allows for scaling the service horizontally and also helps reduce the load caused by the write operations.
1 parent 54f934c commit f9d4a03

3 files changed

Lines changed: 345 additions & 88 deletions

File tree

services/activitylog/pkg/service/options.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type Options struct {
3131
HistoryClient ehsvc.EventHistoryService
3232
ValueClient settingssvc.ValueService
3333
WriteBufferDuration time.Duration
34+
MaxActivities int
3435
}
3536

3637
// Logger configures a logger for the activitylog service
@@ -109,3 +110,10 @@ func WriteBufferDuration(d time.Duration) Option {
109110
o.WriteBufferDuration = d
110111
}
111112
}
113+
114+
// MaxActivities sets the maximum number of activities to store
115+
func MaxActivities(max int) Option {
116+
return func(o *Options) {
117+
o.MaxActivities = max
118+
}
119+
}

0 commit comments

Comments
 (0)