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

Wrong data is getting inserted in timeseries #181

Open
atharva29 opened this issue Apr 8, 2024 · 1 comment
Open

Wrong data is getting inserted in timeseries #181

atharva29 opened this issue Apr 8, 2024 · 1 comment

Comments

@atharva29
Copy link

I am pushing some data in redistimeseries. Before pushing i am logging the data. After that through Redis cli if i check the data, then it shows some values as random and some actual values that i am pushing. Following is my code. I have also created a compaction buckets of 1 min O H L C and 5 min OHLC (OPEN HIGH LOW CLOSE). Some random samples are also getting inserted in source bucket i.e. ts_25

`func (r *RedisClient) saveChartToRedis() {
defer logger.NewLogger.Info("closing saveChartToRedis")
for feed := range r.chartChan {
keyname := fmt.Sprintf("ts_%d", feed.ScripCode)

	timeFormat := "02/01/2006 15:04:05"
	t, err := time.Parse(timeFormat, feed.LastUpdatedTime)
	if err != nil {
		logger.NewLogger.Error("CHART TIME ERROR: ", err.Error())
		continue
	}
	fmt.Println("Pushing data to ", feed.ExchangeCode, 25, keyname, float64(feed.Ltp), "@", feed.LastUpdatedTime)
	if _, err := r.ts.AddWithOptions(keyname, t.Unix(), float64(feed.Ltp), redistimeseries.CreateOptions{DuplicatePolicy: redistimeseries.FirstDuplicatePolicy}); err != nil {
		logger.NewLogger.Error("CHART ERROR: ", err.Error())
		continue
	}

}

}`

@LiorKogan
Copy link
Member

redistimeseries-go is now deprecated. Please witch to go-redis version 9.2+ with support for RTS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants