Coder Social home page Coder Social logo

Bug in datahistorymanager about gocryptotrader HOT 4 OPEN

bijanx avatar bijanx commented on July 21, 2024
Bug in datahistorymanager

from gocryptotrader.

Comments (4)

gloriousCode avatar gloriousCode commented on July 21, 2024 1

Thank you for providing the CLI command you are using and the (unfortunate) panic response. It'll make looking into things much easier.

I'll do an investigation soon, post what I've found and from there, look into developing a solution

from gocryptotrader.

bijanx avatar bijanx commented on July 21, 2024

More information

It's failing here:

// LoadFromDatabase returns Item from database seeded data
func LoadFromDatabase(exchange string, pair currency.Pair, a asset.Item, interval Interval, start, end time.Time) (*Item, error) {
	retCandle, err := candle.Series(exchange,
		pair.Base.String(), pair.Quote.String(),
		int64(interval.Duration().Seconds()), a.String(), start, end)

	if err != nil {
		return nil, err
	}

err is not nil, so it returns nil, then tries to call here but candles is nil, which causes the panic

err = jobs[i].rangeHolder.SetHasDataFromCandles(candles.Candles)

Not sure what the expected behavior is here. Should it return an empty struct instead? I will give that a shot.

from gocryptotrader.

bijanx avatar bijanx commented on July 21, 2024

In database/repository/candle/candle.go in the function Series there's this:

	if len(out.Candles) < 1 {
		return out, fmt.Errorf("%w: %s %s %s %v %s", ErrNoCandleDataFound, exchangeName, base, quote, interval, asset)
	}

Since there's no data in the DB yet, it's returning an error which is causing the issue downstream.

I've commented this out but it seems to be silently failing now because it hasn't ingested any data.

from gocryptotrader.

bijanx avatar bijanx commented on July 21, 2024

That fixes this issue actually. It's failing for a different reason:

[ERROR] | DATAHISTORY | 16/04/2024 09:02:37 | GateIO unsuccessful HTTP status code: 400 raw response: {"label":"INVALID_PARAM_VALUE","message":"Candlestick too long ago. Maximum 10000 points ago are allowed"}

from gocryptotrader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.