@@ -24,16 +24,16 @@ var REGISTRY_STORE_CLASS_FOR_SCHEME map[string]string = map[string]string{
24
24
*/
25
25
26
26
type Registry struct {
27
- registryStore RegistryStore
28
- cachedFeatureServices map [string ]map [string ]* core.FeatureService
29
- cachedEntities map [string ]map [string ]* core.Entity
30
- cachedFeatureViews map [string ]map [string ]* core.FeatureView
31
- cachedOnDemandFeatureViews map [string ]map [string ]* core.OnDemandFeatureView
32
- cachedRequestFeatureViews map [string ]map [string ]* core.RequestFeatureView
33
- cachedRegistry * core.Registry
34
- cachedRegistryProtoCreated time.Time
35
- cachedRegistryProtoTtl time.Duration
36
- mu sync.Mutex
27
+ registryStore RegistryStore
28
+ cachedFeatureServices map [string ]map [string ]* core.FeatureService
29
+ cachedEntities map [string ]map [string ]* core.Entity
30
+ cachedFeatureViews map [string ]map [string ]* core.FeatureView
31
+ cachedOnDemandFeatureViews map [string ]map [string ]* core.OnDemandFeatureView
32
+ cachedRequestFeatureViews map [string ]map [string ]* core.RequestFeatureView
33
+ cachedRegistry * core.Registry
34
+ cachedRegistryProtoLastUpdated time.Time
35
+ cachedRegistryProtoTtl time.Duration
36
+ mu sync.Mutex
37
37
}
38
38
39
39
func NewRegistry (registryConfig * RegistryConfig , repoPath string ) (* Registry , error ) {
@@ -86,7 +86,7 @@ func (r *Registry) refresh() error {
86
86
}
87
87
88
88
func (r * Registry ) getRegistryProto () (* core.Registry , error ) {
89
- expired := r .cachedRegistry == nil || (r .cachedRegistryProtoTtl > 0 && time .Now ().After (r .cachedRegistryProtoCreated .Add (r .cachedRegistryProtoTtl )))
89
+ expired := r .cachedRegistry == nil || (r .cachedRegistryProtoTtl > 0 && time .Now ().After (r .cachedRegistryProtoLastUpdated .Add (r .cachedRegistryProtoTtl )))
90
90
if ! expired {
91
91
return r .cachedRegistry , nil
92
92
}
@@ -112,7 +112,7 @@ func (r *Registry) load(registry *core.Registry) {
112
112
r .loadFeatureViews (registry )
113
113
r .loadOnDemandFeatureViews (registry )
114
114
r .loadRequestFeatureViews (registry )
115
- r .cachedRegistryProtoCreated = time .Now ()
115
+ r .cachedRegistryProtoLastUpdated = time .Now ()
116
116
}
117
117
118
118
func (r * Registry ) loadEntities (registry * core.Registry ) {
0 commit comments