XF 2.2 Why don't trophies get awarded right away?

It's a strange behaviour that trophies don't get awarded the moment a user does a behaviour that should trigger it. Instead, it often takes hours to see it get awarded. Recently I had to manually run a cron job after none got added for many hours.
 
Solution
There may certainly be a problem on my server end. Could something be limiting cron? Like limitations set by the host outside of Xenforo?
Only thing you can really do is changed "Job run trigger" to be "server-based" instead of "activity-based". The latter, which is the default, waits for a user to perform an action before checking for (and possibly executing) queued jobs. If you have a small/inactive site then it can take ages for these checks/executions to happen.

Otherwise as Tracy said this is pretty much how XF is designed. Imagine if all XF jobs and addon-provided jobs didn't use an enqueued jobs system, but instead were just various checks placed in the overall code. With a large enough site, and enough addons installed...
It's a strange behaviour that trophies don't get awarded the moment a user does a behaviour that should trigger it. Instead, it often takes hours to see it get awarded. Recently I had to manually run a cron job after none got added for many hours.
Simply... it takes a CRON job to run before they are awarded. You can edit that CRON job to run more frequently... but at some point you can add to the overload of your site ability.
They run at every 40 minutes on the hour by default (if I remember correctly). You can go into developer mode (I think it is) and edit that to run more often)... but why? Is instant gratification a requirement (which is something that impacts all forums when compared to social media)? The more load you put on the system (from it's default settings) the more (as your membership increases) you are going to have to increase the base of the site. Then you have the fact that those "upgraded" have to have been active in a certain time period. Folks that haven't accessed the site in months aren't going to get upgraded by default.
 
Simply... it takes a CRON job to run before they are awarded. You can edit that CRON job to run more frequently... but at some point you can add to the overload of your site ability.
They run at every 40 minutes on the hour by default (if I remember correfctly). You can go into developer mode (I think it is) and edit that to run more often)... but why. Is instant gratification a requirement (which is something that impacts all forums when compared to social media)?
People are animals and desire rapid reinforcement. I consider this behaviour basic responsiveness, something I expect from a proprietary commercial product I paid for. Since it sounds like the only option, I'll look into creating a custom cron job that runs more frequently, but it's weird that after HOURS no trophy was awarded, despite conditions being met. And that I had to run it manually for it to be applied. It should trigger almost immediately once a condition is met — right on cue. This reinforces the behaviour. Otherwise, it comes across as a bug. The user does something that they expect will award them, only for nothing for a long time. Not good.
 
If the cron is not being ran on the X:40 mark (by default if I remember correctly) then you have other factors in play that are keeping the trophy from being awarded.
And no, it does not trigger immediately.. in fact, I'm pretty sure it triggers at the x:40 mark unless you change it to more often.
Once more.... immediately gratification is not a prerequisite of XenForo. You get what you get when it's provided (unless you manually edit it).
There is no "bug".. but it is "as designed"... and you may not agree with the time set by default... but you can change that.
 
If the cron is not being ran on the X:40 mark (by default if I remember correctly) then you have other factors in play that are keeping the trophy from being awarded.
And no, it does not trigger immediately.. in fact, I'm pretty sure it triggers at the x:40 mark unless you change it to more often.
Once more.... immediately gratification is not a prerequisite of XenForo. You get what you get when it's provided (unless you manually edit it).
There is no "bug".. but it is "as designed"... and you may not agree with the time set by default... but you can change that.
I'm not sure why you dismiss responsiveness. Especially in this day and age. It is what people expect and have grown accustomed to. Could you imagine if you posted a message or sent an email, and it took more than 30 minutes to send? Well maybe you wouldn't mind, but many others would.

There may certainly be a problem on my server end. Could something be limiting cron? Like limitations set by the host outside of Xenforo?
 
There may certainly be a problem on my server end. Could something be limiting cron? Like limitations set by the host outside of Xenforo?
Only thing you can really do is changed "Job run trigger" to be "server-based" instead of "activity-based". The latter, which is the default, waits for a user to perform an action before checking for (and possibly executing) queued jobs. If you have a small/inactive site then it can take ages for these checks/executions to happen.

Otherwise as Tracy said this is pretty much how XF is designed. Imagine if all XF jobs and addon-provided jobs didn't use an enqueued jobs system, but instead were just various checks placed in the overall code. With a large enough site, and enough addons installed, doing simple things like just refreshing to board index could take ages, because the forum would be checking for user Trophies, check for user group Upgrades, rebuild user stats, etc when it doesn't really need to.
 
Solution
I'm not sure why you dismiss responsiveness. Especially in this day and age. It is what people expect and have grown accustomed to. Could you imagine if you posted a message or sent an email, and it took more than 30 minutes to send? Well maybe you wouldn't mind, but many others would.

There may certainly be a problem on my server end. Could something be limiting cron? Like limitations set by the host outside of Xenforo?
I don't dismiss it... but the need for instant gratification can be resolved by modifying when the CRON runs. If you don't have high activity, instead of user based running of CRON, you can set it to check the events every minute in case your site is not busy (which is what I do). If your server environment can support it as you grow...knock yourself out John.. Now, the NEED for instant gratification is a societal issue.
Many of those CRON's only get applied when a user has been recently active.
 
Only thing you can really do is changed "Job run trigger" to be "server-based" instead of "activity-based". The latter, which is the default, waits for a user to perform an action before checking for (and possibly executing) queued jobs. If you have a small/inactive site then it can take ages for these checks/executions to happen.

Otherwise as Tracy said this is pretty much how XF is designed. Imagine if all XF jobs and addon-provided jobs didn't use an enqueued jobs system, but instead were just various checks placed in the overall code. With a large enough site, and enough addons installed, doing simple things like just refreshing to board index could take ages, because the forum would be checking for user Trophies, check for user group Upgrades, rebuild user stats, etc when it doesn't really need to.
Thank you, that was probably why and should resolve it.
 
Just bear in mind modifying the original cron will revert on any upgrades. It may be better to copy the cron and create a second one that will survive upgrades. Then you can either disable the original one or have them both running.
 
It's done that way for performance, the same reason promotions aren't immediate. If it had to check every single trophy/promotion after every single action by every single user (or which affects another user when you do something), which is what it'd have to do for it to be instant, then on even a moderately large board the performance would be terrible. So it's done in bulk on a delay once an hour.
 
Top Bottom