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

Improve performance. Avoiding extra request. #40

Open
rrpadilla opened this issue Jun 5, 2020 · 3 comments
Open

Improve performance. Avoiding extra request. #40

rrpadilla opened this issue Jun 5, 2020 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@rrpadilla
Copy link

Hi,
I think you are making an extra request if you do not have to update the user timezone.
See L50-L60

Maybe you should check first if you have to update the user timezone. See recommended code below:

if (config('timezone.overwrite') == true || $user->timezone == null) {
        $ip = $this->getFromLookup();
        $geoip_info = geoip()->getLocation($ip);

        if ($user->timezone != $geoip_info['timezone']) {
                $user->timezone = $geoip_info['timezone'];
                $user->save();

                $this->notify($geoip_info);
        }
}       
@amandiobm
Copy link
Contributor

Hey, tks for the clinic eye on it. I wouldn't say an extra request, but an unnecessary one. We will be fixing soon with the provided suggestion ;)

@jamesmills
Copy link
Owner

Just checking in, did this get looked at?

@jamesmills
Copy link
Owner

Thanks @rrpadilla for this suggestions.

I was wondering if you would be willing to open a PR with your suggested update so that we could get this into the package. Anything to improve the performance of the package would be greatly appreciated.

Thanks for taking the time to contribute and I hope you continue to enjoy using the package.

James

@jamesmills jamesmills added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants