mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-24 01:00:18 +01:00
mtredisalze: made quantification a constant (default 1). Increase value if the _really_ produces too much data.
This commit is contained in:
parent
617a3081b2
commit
02593a22d1
@ -11,6 +11,9 @@ import (
|
||||
"bitbucket.org/s_l_teichmann/mtredisalize/common"
|
||||
)
|
||||
|
||||
// Pull up if it _really_ produces too much data.
|
||||
const quantizationFactor = 1
|
||||
|
||||
type quantizedXZ struct {
|
||||
X, Z int16
|
||||
}
|
||||
@ -32,12 +35,13 @@ func (ct *ChangeTracker) BlockChanged(key []byte) {
|
||||
return
|
||||
}
|
||||
ct.mutex.Lock()
|
||||
ct.changes[quantizedXZ{X: coord.X / 16, Z: coord.Z / 16}] = true
|
||||
ct.changes[quantizedXZ{
|
||||
X: coord.X / quantizationFactor,
|
||||
Z: coord.Z / quantizationFactor}] = true
|
||||
ct.mutex.Unlock()
|
||||
}
|
||||
|
||||
func (ct *ChangeTracker) FlushChanges(url string) (err error) {
|
||||
log.Println("change flush triggered")
|
||||
var oldChanges map[quantizedXZ]bool
|
||||
ct.mutex.Lock()
|
||||
if len(ct.changes) > 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user