Skip to content

Instantly share code, notes, and snippets.

@MelissaKaulfuss
Last active July 29, 2019 01:31
Show Gist options
  • Save MelissaKaulfuss/e7dabdb9f495b8bf3f11a7cfc0ef5ccc to your computer and use it in GitHub Desktop.
Save MelissaKaulfuss/e7dabdb9f495b8bf3f11a7cfc0ef5ccc to your computer and use it in GitHub Desktop.
Reprocessing Shari events that weren't handled

New School

  1. get the aggregate_id for the events that need to be reprocessed (the last successful event).
  2. You can do this via the Platform CLI or the rails c of the app in question (the former is the most advisable).
  3. The new Shari reprocess helper method can simply take the aggregate as the arg like so: reprocess(aggregate_id) |

Old School

  1. Get the event id/s for the event/s that weren't handled
  2. Connect to console for the app in question 3. then sudo su deploy, cd/app_name/current etc.
  3. Retrieve the event/s e = Shari::Repositories::EventRecord.where(id: ["158674a1-9331-5004-a548-3eddcf0eb718", "81a6768a-742f-58a3-9d70-ff68e97124fd", "3828c7d9-8954-53f7-80fe-b71888eebc87"])
  4. reprocess the event/s that initially failed to be handled e.each { |event| Shari::Services::EventProcessor.process(event.attributes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment