Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
Change CLI approach and copyright fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz committed Sep 22, 2022
1 parent 9ea176b commit 195a1c2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
44 changes: 20 additions & 24 deletions cmd/temporalite/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,19 @@ var (
)

const (
ephemeralFlag = "ephemeral"
dbPathFlag = "filename"
portFlag = "port"
metricsPortFlag = "metrics-port"
uiPortFlag = "ui-port"
headlessFlag = "headless"
ipFlag = "ip"
logFormatFlag = "log-format"
logLevelFlag = "log-level"
namespaceFlag = "namespace"
pragmaFlag = "sqlite-pragma"
configFlag = "config"
dynamicConfigValueFlag = "dynamic-config-value"
searchAttributeCacheFlag = "search-attribute-cache"
ephemeralFlag = "ephemeral"
dbPathFlag = "filename"
portFlag = "port"
metricsPortFlag = "metrics-port"
uiPortFlag = "ui-port"
headlessFlag = "headless"
ipFlag = "ip"
logFormatFlag = "log-format"
logLevelFlag = "log-level"
namespaceFlag = "namespace"
pragmaFlag = "sqlite-pragma"
configFlag = "config"
dynamicConfigValueFlag = "dynamic-config-value"
)

func init() {
Expand Down Expand Up @@ -154,10 +153,6 @@ func buildCLI() *cli.App {
Name: dynamicConfigValueFlag,
Usage: `dynamic config value, as KEY=JSON_VALUE (meaning strings need quotes)`,
},
&cli.BoolFlag{
Name: searchAttributeCacheFlag,
Usage: `enable search attribute cache`,
},
},
Before: func(c *cli.Context) error {
if c.Args().Len() > 0 {
Expand Down Expand Up @@ -278,16 +273,17 @@ func buildCLI() *cli.App {
if err != nil {
return err
}
// If there is no config value for search attribute cache disabling,
// default it to true
if len(configVals[dynamicconfig.ForceSearchAttributesCacheRefreshOnRead]) == 0 {
configVals[dynamicconfig.ForceSearchAttributesCacheRefreshOnRead] = []dynamicconfig.ConstrainedValue{
{Value: true},
}
}
for k, v := range configVals {
opts = append(opts, temporalite.WithDynamicConfigValue(k, v))
}

// We put the search attribute cache flag after dynamic config since it
// is essentially just a dynamic config setting internally
if !c.Bool(searchAttributeCacheFlag) {
opts = append(opts, temporalite.WithSearchAttributeCacheDisabled())
}

s, err := temporalite.NewServer(opts...)
if err != nil {
return err
Expand Down
4 changes: 4 additions & 0 deletions cmd/temporalite/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the MIT License.
//
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.

package main

import (
Expand Down

0 comments on commit 195a1c2

Please sign in to comment.