--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-dev+unsubscribe@googlegroups.com.
To post to this group, send email to silverstripe-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/silverstripe-dev.
For more options, visit https://groups.google.com/d/optout.
Do you have a code sample that demonstrates the full cycle (particularly to ensure it's reproducible)? It's unclear what could be causing that without a bit more context. i.e. This requires us to know things that we cannot know e.g. what's actually in the email? what is supposed to be in the email vs. what's supposed to be in the database? Was the content in the email the same content that WAS in the database prior to updating (at which point was supposed to be the content that would be in the email)? This could help explain why on earth flushing the cache helps;My first guess (due to lack of code) is that templates are involved, yes, but may be getting reused within the same request (since template values are idempotent, or, don't change once called). That or maybe you're using <% cached ... %> blocks and need to use a better cache key (or don't do caching at all at this level), etc.
On Sun, Dec 11, 2016 at 8:54 PM, Nicolaas Thiemen Francken <nfra...@gmail.com> wrote:
Hi,I am having a hard time trying to fix racing condition like issues:
- User presses go.
- Site does a bunch of stuff (and saves in Database)
- E-mail is sent to user.
ISSUEWhen the email is sent to the user, the data in the e-mail is not what is actually supposed to be in the database by the time the e-mail is sent.SOLUTION 1: NOT GOODI dont want to use SS_Viewer::flush() to flush the entire cache (this flushes way to much).SOLUTION 2: sleep DID NOT WORKI have tried to use sleep(5) - did not work.SOLUTION 3: register_shutdown_function DID NOT WORKI have also tried to use register_shutdown_function, but also no luck with this method (the concept worked fine, but the e-mail still contained outdated information).What is the best way forward? Any recommendations?Thank youNicolaas
--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
To post to this group, send email to silverst...@googlegroups.com.
Visit this group at https://groups.google.com/group/silverstripe-dev.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
To post to this group, send email to silverst...@googlegroups.com.
Visit this group at https://groups.google.com/group/silverstripe-dev.
For more options, visit https://groups.google.com/d/optout.
Sam Minnée
CEO
SilverStripe Limited
Phone: +64 4 978 7334
Twitter: @sminnee
Educated guess: you don’t reload data from DB before you pass it to the mail? Sometimes when writing to DB not all changes are reflected in the current object, so in doubt re-fetch the data.
--
--
You received this message because you are subscribed to the Google Groups "SilverStripe Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverstripe-d...@googlegroups.com.
To post to this group, send email to silverst...@googlegroups.com.
Visit this group at https://groups.google.com/group/silverstripe-dev.
For more options, visit https://groups.google.com/d/optout.