Skip to content

Commit

Permalink
Merge pull request #2 from toga4/fix-state-cli
Browse files Browse the repository at this point in the history
Fix value of State enums, Fix to set default value of metadata database
  • Loading branch information
toga4 authored Jan 8, 2023
2 parents 6870c05 + b348e18 commit ac2e470
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion cmd/spream/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Options:

fs.StringVar(&flags.database, "database", "", "")
fs.StringVar(&flags.streamName, "stream", "", "")
fs.StringVar(&flags.metadataTableName, "metadata-table", flags.database, "")
fs.StringVar(&flags.metadataTableName, "metadata-table", "", "")
fs.StringVar(&flags.metadataDatabase, "metadata-database", flags.database, "")
fs.DurationVar(&flags.heartbeatInterval, "heartbeat-interval", 10*time.Second, "")

Expand All @@ -79,6 +79,9 @@ Options:
fs.Usage()
return nil, errors.New("database and stream is required")
}
if flags.metadataDatabase == "" {
flags.metadataDatabase = flags.database
}

if start != "" {
t, err := time.Parse(time.RFC3339, start)
Expand Down
8 changes: 4 additions & 4 deletions partition_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ type PartitionMetadata struct {
type State string

const (
StateCreated State = "Created"
StateScheduled State = "Scheduled"
StateRunning State = "Running"
StateFinished State = "Finished"
StateCreated State = "CREATED"
StateScheduled State = "SCHEDULED"
StateRunning State = "RUNNING"
StateFinished State = "FINISHED"
)

const (
Expand Down

0 comments on commit ac2e470

Please sign in to comment.