Skip to content

Commit

Permalink
Corrects the config-store handling for not-found errors (#5203)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidporter-id-au authored Apr 12, 2023
1 parent 9fc4485 commit eade936
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions common/persistence/nosql/nosqlConfigStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func NewNoSQLConfigStore(

func (m *nosqlConfigStore) FetchConfig(ctx context.Context, configType persistence.ConfigType) (*persistence.InternalConfigStoreEntry, error) {
entry, err := m.db.SelectLatestConfig(ctx, int(configType))
if m.db.IsNotFoundError(err) {
return nil, nil
}
if err != nil {
return nil, convertCommonErrors(m.db, "FetchConfig", err)
}
Expand Down
5 changes: 0 additions & 5 deletions common/persistence/nosql/nosqlplugin/cassandra/configStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import (
"context"
"time"

"github.com/gocql/gocql"

"github.com/uber/cadence/common"
"github.com/uber/cadence/common/persistence"
"github.com/uber/cadence/common/persistence/nosql/nosqlplugin"
Expand Down Expand Up @@ -58,9 +56,6 @@ func (db *cdb) SelectLatestConfig(ctx context.Context, rowType int) (*persistenc

query := db.session.Query(templateSelectLatestConfig, rowType).WithContext(ctx)
err := query.Scan(&rowType, &version, &timestamp, &data, &encoding)
if err == gocql.ErrNotFound {
return nil, nil
}
if err != nil {
return nil, err
}
Expand Down

0 comments on commit eade936

Please sign in to comment.