Attachments:

This error occurs when you are trying to make a change to live whilst processing a notification from live, which is not possible. its indicating the you need to defer the update to live and let the processing finish (or it’s a bug in your code)

I can’t see how this can happen from the patch you’ve posted above – is that it or is there more?