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

Using incomplete cache key results in duplicate data when querying multiple basecurrencies. #8

Closed
dan-da opened this issue Nov 9, 2017 · 2 comments

Comments

@dan-da
Copy link
Owner

dan-da commented Nov 9, 2017

I found this problem in the course of investigating:
bisq-network/analytics#1 (comment)

A memory cache is used to store results temporarily during a request. The cache key was not including information about the basecurrency, thus the first result stored for a given key would be used even for other base currencies.

wrong code:

        static $results = null;
        $val = @$results[$key];
        if( $val ) {
            return $val;
        }

fixed code:

        static $results = null;
        $fullkey = $file . $key;
        $val = @$results[$fullkey];
        if( $val ) {
            return $val;
        }
dan-da pushed a commit that referenced this issue Nov 9, 2017
@dan-da
Copy link
Owner Author

dan-da commented Nov 9, 2017

fixed in fd377e3

@dan-da dan-da closed this as completed Nov 9, 2017
@dan-da
Copy link
Owner Author

dan-da commented Nov 9, 2017

related commits: 8dded19 and 64a002e

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

1 participant