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

[IMP] gamification, *: imp selection of cron-updated goals (Backport) #615

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

CarmenMiranda
Copy link

*: base

In the cron updating challenges goals, we were historically filtering in records of users that logged in since the last update. This doesn't work because sessions can last a long time, so users are active between cron runs but their goals are not updated and stale reports were sent.

We temporarily fixed this in v14.0 by updating all goals for internal users, but this can lead to unnecessary computations too, and still misses goals of active portal users.

Instead, we are here using the bus.presence records to track user activity, combining it with the session lifetime to avoid indefinitely fetching old goals that couldn't need an update.
This works for both internal and portal users.

Note: we update stale base comments in favor of exposing bus.presence to guide developers.

Task-3148858

closes odoo#121763

Signed-off-by: Thibault Delavallee (tde) [email protected]

Back-port of: odoo@466ab1e


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

*: base

In the cron updating challenges goals, we were historically filtering
in records of users that logged in since the last update. This doesn't
work because sessions can last a long time, so users are active between
cron runs but their goals are not updated and stale reports were sent.

We temporarily fixed this in v14.0 by updating all goals for internal
users, but this can lead to unnecessary computations too, and still
misses goals of active portal users.

Instead, we are here using the `bus.presence` records to track user
activity, combining it with the session lifetime to avoid indefinitely
fetching old goals that couldn't need an update.
This works for both internal and portal users.

Note: we update stale base comments in favor of exposing bus.presence
to guide developers.

Task-3148858

closes odoo#121763

Signed-off-by: Thibault Delavallee (tde) <[email protected]>

Back-port of: odoo@466ab1e
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

Successfully merging this pull request may close these issues.

2 participants