Skip to content

Commit

Permalink
fix hot ttl bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wb-cjh663673 committed Nov 18, 2021
1 parent ba2abd8 commit c5de5e3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion log_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type LogStore struct {
MaxSplitShard int `json:"maxSplitShard"`
AppendMeta bool `json:"appendMeta"`
TelemetryType string `json:"telemetryType"`
HotTTL int `json:"hot_ttl"`
HotTTL uint32 `json:"hot_ttl,omitempty"`

CreateTime uint32 `json:"createTime,omitempty"`
LastModifyTime uint32 `json:"lastModifyTime,omitempty"`
Expand Down
33 changes: 33 additions & 0 deletions logstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,39 @@ func createLogStore(s *LogstoreTestSuite) *LogStore {
return store
}

func (s *LogstoreTestSuite) TestCreateLogStoreWithNewRequestBody() {
client := CreateNormalInterface(s.endpoint, s.accessKeyID, s.accessKeySecret, "")
exist, ce := client.CheckProjectExist(s.projectName)
s.Nil(ce)
if !exist {
_, cpe := client.CreateProject(s.projectName, "go sdk test")
s.Nil(cpe)
}
defer client.DeleteProject(s.projectName)
logStore := &LogStore{
Name: s.logstoreName,
TTL: 7,
ShardCount: 2,
WebTracking: false,
AutoSplit: true,
MaxSplitShard: 16,
AppendMeta: false,
}
err := s.Project.CreateLogStoreV2(logStore)
s.Nil(err)
time.Sleep(time.Second * 10)
store, err := s.Project.GetLogStore(s.logstoreName)
s.Nil(err)
s.Equal(s.logstoreName, store.Name)
s.Equal(7, store.TTL)
s.Equal(2, store.ShardCount)
s.Equal(false, store.WebTracking)
s.Equal(true, store.AutoSplit)
s.Equal(16, store.MaxSplitShard)
s.Equal(false, store.AppendMeta)
s.Equal(uint32(0), store.HotTTL)
}

func (s *LogstoreTestSuite) TestCheckLogStore() {
store, err := s.Project.GetLogStore(s.logstoreName)
s.Nil(err)
Expand Down

0 comments on commit c5de5e3

Please sign in to comment.