mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-10 15:43:09 -06:00
Merge branch 'main' of github.com:matrix-org/dendrite into s7evink/hisvismessages
This commit is contained in:
commit
9b6b6585c2
|
|
@ -44,9 +44,9 @@ const (
|
||||||
|
|
||||||
func NewRistrettoCache(maxCost config.DataUnit, maxAge time.Duration, enablePrometheus bool) *Caches {
|
func NewRistrettoCache(maxCost config.DataUnit, maxAge time.Duration, enablePrometheus bool) *Caches {
|
||||||
cache, err := ristretto.NewCache(&ristretto.Config{
|
cache, err := ristretto.NewCache(&ristretto.Config{
|
||||||
NumCounters: 1e5, // 10x number of expected cache items, affects bloom filter size, gives us room for 10,000 currently
|
NumCounters: int64((maxCost / 1024) * 10), // 10 counters per 1KB data, affects bloom filter size
|
||||||
BufferItems: 64, // recommended by the ristretto godocs as a sane buffer size value
|
BufferItems: 64, // recommended by the ristretto godocs as a sane buffer size value
|
||||||
MaxCost: int64(maxCost),
|
MaxCost: int64(maxCost), // max cost is in bytes, as per the Dendrite config
|
||||||
Metrics: true,
|
Metrics: true,
|
||||||
KeyToHash: func(key interface{}) (uint64, uint64) {
|
KeyToHash: func(key interface{}) (uint64, uint64) {
|
||||||
return z.KeyToHash(key)
|
return z.KeyToHash(key)
|
||||||
|
|
|
||||||
|
|
@ -619,7 +619,7 @@ func rowsToStreamEvents(rows *sql.Rows) ([]types.StreamEvent, error) {
|
||||||
TransactionID: *txnID,
|
TransactionID: *txnID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ev.Visibility = historyVisibility
|
||||||
result = append(result, types.StreamEvent{
|
result = append(result, types.StreamEvent{
|
||||||
HeaderedEvent: &ev,
|
HeaderedEvent: &ev,
|
||||||
StreamPosition: streamPos,
|
StreamPosition: streamPos,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue