Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kafka_consumer: fix wrong timezone when 'TZ' env is not set and downstream is mysql #1084

Merged
merged 2 commits into from
Nov 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions kafka_consumer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,9 @@ type Consumer struct {
// NewConsumer creates a new cdc kafka consumer
func NewConsumer(ctx context.Context) (*Consumer, error) {
// TODO support filter in downstream sink
tz := time.Local
if strings.ToLower(timezone) != "system" {
var err error
tz, err = time.LoadLocation(timezone)
if err != nil {
return nil, errors.Annotate(err, "can not load timezone")
}
tz, err := util.GetTimezone(timezone)
if err != nil {
return nil, errors.Annotate(err, "can not load timezone")
}
ctx = util.PutTimezoneInCtx(ctx, tz)
filter, err := cdcfilter.NewFilter(config.GetDefaultReplicaConfig())
Expand Down