Skip to content

Commit

Permalink
Merge pull request #1518 from josephschorr/invert-flag
Browse files Browse the repository at this point in the history
Invert the flag for the new schema watching cache
  • Loading branch information
josephschorr authored Aug 30, 2023
2 parents d4b4924 + 9f0d79d commit eb0d8cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func RegisterServeFlags(cmd *cobra.Command, config *server.Config) error {
}
server.RegisterCacheFlags(cmd.Flags(), "ns-cache", &config.NamespaceCacheConfig, namespaceCacheDefaults)

cmd.Flags().BoolVar(&config.DisableWatchableSchemaCache, "disable-watchable-schema-cache", false, "disables the schema cache which makes use of the Watch API for automatic updates")
cmd.Flags().BoolVar(&config.EnableExperimentalWatchableSchemaCache, "enable-experimental-watchable-schema-cache", false, "enables the experimental schema cache which makes use of the Watch API for automatic updates")

// Flags for parsing and validating schemas.
cmd.Flags().BoolVar(&config.SchemaPrefixesRequired, "schema-prefixes-required", false, "require prefixes on all object definitions in schemas")
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ type Config struct {
MaxRelationshipContextSize int `debugmap:"visible" default:"25_000"`

// Namespace cache
DisableWatchableSchemaCache bool `debugmap:"visible"`
NamespaceCacheConfig CacheConfig `debugmap:"visible"`
EnableExperimentalWatchableSchemaCache bool `debugmap:"visible"`
NamespaceCacheConfig CacheConfig `debugmap:"visible"`

// Schema options
SchemaPrefixesRequired bool `debugmap:"visible"`
Expand Down Expand Up @@ -218,9 +218,9 @@ func (c *Config) Complete(ctx context.Context) (RunnableServer, error) {
}
log.Ctx(ctx).Info().EmbedObject(nscc).Msg("configured namespace cache")

cachingMode := schemacaching.WatchIfSupported
if c.DisableWatchableSchemaCache {
cachingMode = schemacaching.JustInTimeCaching
cachingMode := schemacaching.JustInTimeCaching
if c.EnableExperimentalWatchableSchemaCache {
cachingMode = schemacaching.WatchIfSupported
}

ds = schemacaching.NewCachingDatastoreProxy(ds, nscc, c.DatastoreConfig.GCWindow, cachingMode)
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/server/zz_generated.options.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eb0d8cc

Please sign in to comment.