enable LinearImport for diffCache during import
parent
639c206b16
commit
63794491f6
|
@ -237,8 +237,6 @@ func newRefIndex(path string, opts *cacheOptions) (*bunchRefCache, error) {
|
|||
index.waitWrite = &sync.WaitGroup{}
|
||||
index.waitAdd = &sync.WaitGroup{}
|
||||
|
||||
// index.SetLinearImport(true)
|
||||
|
||||
return &index, nil
|
||||
}
|
||||
|
||||
|
@ -259,6 +257,8 @@ func (index *bunchRefCache) SetLinearImport(val bool) {
|
|||
index.waitAdd.Wait()
|
||||
close(index.write)
|
||||
index.waitWrite.Wait()
|
||||
|
||||
index.linearImport = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -100,19 +100,16 @@ func TestWriteDiff(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal()
|
||||
}
|
||||
defer cache.Close()
|
||||
cache.SetLinearImport(true)
|
||||
|
||||
for w := 0; w < 5; w++ {
|
||||
for n := 0; n < 200; n++ {
|
||||
cache.add(int64(n), int64(w))
|
||||
}
|
||||
}
|
||||
cache.Close()
|
||||
|
||||
cache, err = newRefIndex(cache_dir, &globalCacheOptions.CoordsIndex)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer cache.Close()
|
||||
cache.SetLinearImport(false)
|
||||
|
||||
for n := 0; n < 200; n++ {
|
||||
refs := cache.Get(int64(n))
|
||||
|
|
|
@ -240,6 +240,10 @@ func mainimport() {
|
|||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if diffCache != nil {
|
||||
diffCache.Coords.SetLinearImport(true)
|
||||
diffCache.Ways.SetLinearImport(true)
|
||||
}
|
||||
osmCache.Coords.SetReadOnly(true)
|
||||
pointsTagMatcher := tagmapping.PointMatcher()
|
||||
lineStringsTagMatcher := tagmapping.LineStringMatcher()
|
||||
|
|
Loading…
Reference in New Issue