Mercurial > gemma
comparison pkg/octree/cache.go @ 727:41c8dc61f38f
Moved octree loading stuff to octree package.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sat, 22 Sep 2018 21:57:30 +0200 |
parents | e0437ec46798 |
children | a244b18cb916 |
comparison
equal
deleted
inserted
replaced
726:5af9ab39e715 | 727:41c8dc61f38f |
---|---|
13 bottleneck string | 13 bottleneck string |
14 } | 14 } |
15 | 15 |
16 cacheEntry struct { | 16 cacheEntry struct { |
17 checksum string | 17 checksum string |
18 tree *Octree | 18 tree *Tree |
19 access time.Time | 19 access time.Time |
20 } | 20 } |
21 OctreeCache struct { | 21 OctreeCache struct { |
22 sync.Mutex | 22 sync.Mutex |
23 entries map[cacheKey]*cacheEntry | 23 entries map[cacheKey]*cacheEntry |
75 } | 75 } |
76 | 76 |
77 func (oc *OctreeCache) Get( | 77 func (oc *OctreeCache) Get( |
78 bottleneck string, date time.Time, | 78 bottleneck string, date time.Time, |
79 conn *sql.Conn, ctx context.Context, | 79 conn *sql.Conn, ctx context.Context, |
80 ) (*Octree, error) { | 80 ) (*Tree, error) { |
81 oc.Lock() | 81 oc.Lock() |
82 defer oc.Unlock() | 82 defer oc.Unlock() |
83 | 83 |
84 key := cacheKey{date, bottleneck} | 84 key := cacheKey{date, bottleneck} |
85 entry := oc.entries[key] | 85 entry := oc.entries[key] |