Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit e3f5729

Browse files
authored
Revert "Schema cache (#1165)" (#1177)
This reverts commit f8bce5d.
1 parent f8bce5d commit e3f5729

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

quesma/schema/registry.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"quesma/quesma/config"
99
"quesma/util"
1010
"sync"
11-
"time"
1211
)
1312

1413
// TODO we should rethink naming and types used in this package
@@ -38,10 +37,6 @@ type (
3837
fieldEncodings map[FieldEncodingKey]EncodedFieldName
3938
fieldOriginsLock sync.RWMutex
4039
fieldOrigins map[IndexName]map[FieldName]FieldSource
41-
42-
cachedSchemas map[IndexName]Schema
43-
cacheTTL time.Time
44-
cacheMutex sync.Mutex
4540
}
4641
typeAdapter interface {
4742
Convert(string) (QuesmaType, bool)
@@ -80,14 +75,6 @@ func (s *schemaRegistry) getInternalToPublicFieldEncodings(tableName string) map
8075
}
8176

8277
func (s *schemaRegistry) loadSchemas() (map[IndexName]Schema, error) {
83-
84-
s.cacheMutex.Lock()
85-
defer s.cacheMutex.Unlock()
86-
87-
if s.cachedSchemas != nil && time.Now().Before(s.cacheTTL) {
88-
return s.cachedSchemas, nil
89-
}
90-
9178
definitions := s.dataSourceTableProvider.TableDefinitions()
9279
schemas := make(map[IndexName]Schema)
9380

@@ -119,9 +106,6 @@ func (s *schemaRegistry) loadSchemas() (map[IndexName]Schema, error) {
119106
}
120107
}
121108

122-
s.cachedSchemas = schemas
123-
s.cacheTTL = time.Now().Add(5 * time.Second)
124-
125109
return schemas, nil
126110
}
127111

@@ -172,10 +156,6 @@ func (s *schemaRegistry) UpdateDynamicConfiguration(name IndexName, table Table)
172156
}
173157

174158
func (s *schemaRegistry) UpdateFieldEncodings(encodings map[FieldEncodingKey]EncodedFieldName) {
175-
s.cacheMutex.Lock()
176-
defer s.cacheMutex.Unlock()
177-
s.cachedSchemas = nil
178-
179159
s.fieldEncodingsLock.Lock()
180160
defer s.fieldEncodingsLock.Unlock()
181161
for key, value := range encodings {

0 commit comments

Comments
 (0)