作者 kevin

update shared call keys

@@ -15,7 +15,6 @@ import ( @@ -15,7 +15,6 @@ import (
15 ) 15 )
16 16
17 const ( 17 const (
18 - sharedCallsKey = "ensureIndex"  
19 timestampFormat = "2006-01-02T15:04:05.000Z" 18 timestampFormat = "2006-01-02T15:04:05.000Z"
20 timestampKey = "@timestamp" 19 timestampKey = "@timestamp"
21 ) 20 )
@@ -84,7 +83,7 @@ func (idx *Index) GetIndex(m map[string]interface{}) string { @@ -84,7 +83,7 @@ func (idx *Index) GetIndex(m map[string]interface{}) string {
84 } 83 }
85 84
86 func (idx *Index) ensureIndex(index string) error { 85 func (idx *Index) ensureIndex(index string) error {
87 - _, err := idx.sharedCalls.Do(sharedCallsKey, func() (i interface{}, err error) { 86 + _, err := idx.sharedCalls.Do(index, func() (i interface{}, err error) {
88 idx.lock.Lock() 87 idx.lock.Lock()
89 defer idx.lock.Unlock() 88 defer idx.lock.Unlock()
90 89