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

Disable logs totally and fetch currency #13

Open
sukiyanen85 opened this issue Jun 13, 2020 · 4 comments
Open

Disable logs totally and fetch currency #13

sukiyanen85 opened this issue Jun 13, 2020 · 4 comments
Assignees
Labels

Comments

@sukiyanen85
Copy link

Hi,

I'm using rollbar, to track issues\warnings automatically.

My .env configuration:

CC_API_SOURCE=fixer
CC_USE_SSL=false
CC_FIXERIO_ACCESS_KEY=*******************
CC_ENABLE_LOG=false
CC_ENABLE_CACHE=true
CC_CACHE_TIMEOUT=7200

Beside I have cache timetout set to 7200 minutes the log says that the package is trying to get currency each minute, do you have any idea why this is happening?

My second question is, beside I have LOG set to false. Is still recording warning messages ( which are sent to rollbar )

image

Any idea how to solve these 2 issues?

@danielme85 danielme85 self-assigned this Jun 15, 2020
@danielme85 danielme85 added the bug label Jun 15, 2020
@danielme85
Copy link
Owner

Hi @sukiyanen85,
what Laravel version are you on? I'm going to try to replicate the "no for EUR found" from fixer.io

It will try to fetch new data even if you have cache enabled if there is no successful requests (cache only starts/counts when you actually have data).

Oh and: CC_ENABLE_LOG=false/true is more of a debug log option. It will still log warnings and errors! Sorry for the confusion here, I can add some more information about that.

@danielme85
Copy link
Owner

Also there should not be anything that triggers a new request, so I assume you have something in your code that expects it to be cached so every time a conversion is attempted it will try to get the EUR rates.

PS: I just did a live test trough some feature testing (so not 100% real world practical) and fixer.io seems to work there at least.

  • Could you paste me the code where you are using the currency converter?

  • Also can you confirm that your fixer.io is working and you can get a response from their API?

@sukiyanen85
Copy link
Author

Hi @danielme85 thank you for taking the time to review.

I'm using Laravel Framework 6.18.15. Unfortunately, I had to remove this package, since I'm using rollbar free version, and there's a limit of reported events, due to the package log warnings the package was hitting the account limit :(

The package was working fine, but beside I configured 7200 minutes cache, it was called 4211 on the last 20 days.

image

I can confirm that fixer.io was getting the currency correctly.

This was the function I was using to get the currency:

function toPounds($amount)
{
    return Currency::conv('EUR', 'GBP', $amount, 1);
}

@danielme85
Copy link
Owner

Ah I see, sorry about that. Let me check it out later and see if I find a bug

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

No branches or pull requests

2 participants