1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 User Account Expired- Which Cron Controls this?

Discussion in 'XenForo Questions and Support' started by xIsabel38, Dec 3, 2014.

  1. xIsabel38

    xIsabel38 Well-Known Member

    Quick question about user upgrades. Which cron job does it use to downgrade a user when the upgrade expires?

    I tried doing some testing on a user that had an upgrade for 1 day. When the upgrade expired, the user still had the upgrade active. I ran the cron "Downgrade Expired User Upgrades" but the user still had the upgrades. It suddenly downgraded on it's own over 12 hours later sometime during the night.
  2. Liam W

    Liam W Well-Known Member

    It is that cron, however it sets a delay when as to when it decides whether or not the upgrade is expired.

    I believe the delay is set to half an hour (in seconds), so it gets them like this:

    SELECT * FROM xf_user_upgrade_active WHERE end_date <?
    Where ? is
    XenForo_Application::time()-<half an hour>
    So, basically, it'll only get expired user upgrades if they expired half an hour before the cron was run.

  3. xIsabel38

    xIsabel38 Well-Known Member

    Yeah but that still doesn't make sense with that test I did. The user account expired on Dec 1st 10:38AM. Nothing changed. I ran the cron at 11:54AM (almost an hour and a half later) and nothing changed.

    The user account changed on its own at 6:05AM on Dec 2nd which is nearly 20 hours later.

    I'm going to try another test and see how it goes.
  4. Mike

    Mike XenForo Developer Staff Member

    There is a 2 hour delay on downgrading to help ensure that any recurring payment will be processed before the downgrade. Then it's down to when the cron runs after that, which may vary based on forum activity.
    Last edited: Dec 3, 2014

Share This Page