Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dave Pearcey 46 posts 178 karma points
    Jun 04, 2020 @ 13:38
    Dave Pearcey
    0

    Umbraco 8 Updating members overrides other updates

    I have an issue where I'm updating members via a sceduled task at midnight every day and this gets overriden if the member also updated at the same time through usage of their account.

    I am looping through all members and setting a boolean on whether they've logged in that day to false (so next time they log, they get a daily login bonus).

    If the member is currently logged on and doing an action that requires updating their member, this will override what I do with the scheduled task.

    To my understanding, In Umbraco 8, it only updates fields that have been changed, so why would this be occurring?

  • Nik 1599 posts 7179 karma points MVP 6x c-trib
    Jun 04, 2020 @ 14:52
    Nik
    100

    Hey Dave,

    Why not take a different approach and when someone logs in set their "last logged in date", then you can compare the date when they next login to see if the date is the same, if it is apply bonus, if not don't.

    That would save the need for a scheduled task to set a flag.

    Nik

  • Dave Pearcey 46 posts 178 karma points
    Jun 05, 2020 @ 10:46
    Dave Pearcey
    1

    Sometimes the simplest of things escape us. Not a bad idea at all, thank you.

Please Sign in or register to post replies

Write your reply to:

Draft