Skip to content

Commit

Permalink
Convert visibility_ts timestamp to int; add error check in the front …
Browse files Browse the repository at this point in the history
…end handler code. (temporalio#242)
  • Loading branch information
sivakku authored Jun 16, 2017
1 parent 1f6917c commit c02fab2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion common/persistence/cassandraPersistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ const (
)

var (
defaultVisibilityTimestamp = time.Time{} // The zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC
defaultDateTime = time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC)
defaultVisibilityTimestamp = common.UnixNanoToCQLTimestamp(defaultDateTime.UnixNano())
)

type (
Expand Down
8 changes: 7 additions & 1 deletion service/history/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,18 @@ func (s *Service) Start() {
// Hack to create shards for bootstrap purposes
// TODO: properly pre-create all shards before deployment.
for shardID := 0; shardID < p.CassandraConfig.NumHistoryShards; shardID++ {
shardMgr.CreateShard(&persistence.CreateShardRequest{
err := shardMgr.CreateShard(&persistence.CreateShardRequest{
ShardInfo: &persistence.ShardInfo{
ShardID: shardID,
RangeID: 0,
TransferAckLevel: 0,
}})

if err != nil {
if _, ok := err.(*persistence.ShardAlreadyExistError); !ok {
log.Fatalf("failed to create shard for ShardId: %v, with error: %v", shardID, err)
}
}
}

metadata, err := persistence.NewCassandraMetadataPersistence(p.CassandraConfig.Hosts,
Expand Down

0 comments on commit c02fab2

Please sign in to comment.