Problem/Motivation

See DestructableInterface and example implementations.

I would suggest we change to always creating message entities then and then we also eliminate the intermediate event message object and pass the entity to the Job and related classes.

If anything goes wrong with the almost-immediate processing then cron can still pick it up.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork ww_publish-3211093

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Berdir created an issue. See original summary.

johnchque’s picture

Assigned: Unassigned » johnchque

johnchque’s picture

Status: Active » Needs review
berdir’s picture

I've been pondering about this for a while but I pushed a pretty big refactoring now. Event message entities are now always created, and the Job class is now a service which also includes protection against any sort of race condition both from external requests and also mixing the destruct method and running cron in case that overlaps.

This allows to retry a message import if something failed as well as being able to debug and see the received messages when not using the cron-only mode. And we no longer need an intermediate plain message object.

Also updated the settings form label and description to explain the new behavior.

Always having a message also opens up options to improve logging and for example log more information on a field on the message entity instead of watchdog or the nodes.

  • Berdir committed 1656ed9 on 2.x authored by johnchque
    Issue #3211093 by johnchque: Use a destructable service to process...
berdir’s picture

Status: Needs review » Fixed

Committing, will run some more test in our project with this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.