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

Allow to disable LastLoginListener #2908

Open
tinntsea opened this issue May 20, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@tinntsea
Copy link

commented May 20, 2019

Why?

user.last_login gets updated every api request.

How?
Add a new parameter to allow disabling the listener

@tinntsea tinntsea changed the title Allow to disable or configure LastLoginListener Allow to disable LastLoginListener May 29, 2019

@tacman

This comment has been minimized.

Copy link

commented Jun 20, 2019

agreed -- it's an expensive query (because it's an update, not simply a read like getting the user). Especially in API calls.

@tacman

This comment has been minimized.

Copy link

commented Jun 20, 2019

One way to disable it is to override the method in User.php

    // hack to disable lastLogin update 
    public function setLastLogin(\DateTime $time = null) {}
@devtronic

This comment has been minimized.

Copy link

commented Jun 20, 2019

You can try to create a compiler pass which removes the service / event from the container
https://symfony.com/doc/current/service_container/compiler_passes.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.