-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[service] service is not being deleted measures #6
Conversation
6b53e74
to
3ab9524
Compare
I don't think this is the problem 🤔 It is normal to thing the events have not been created because they are not in the DB anymore but that may be because we have a Janitor that removes old events (we had to do this because we ended up with a table of 130GB of events before doing this 😂 ): Line 24 in 6f74cf3
porta/app/workers/janitor_worker.rb Line 10 in 4a15c8a
porta/app/workers/purge_old_events_worker.rb Lines 1 to 14 in 4a15c8a
porta/app/lib/event_store/event.rb Lines 56 to 58 in 4a15c8a
But I don't see where it could have done this action (through a controller) without using the state machine 😄 I suspect the customer used the API to delete the service, since it was used for everything else. Specially the part where they said this after they had already deleted the service:
And if you create a require 'test_helper'
class Services::ServiceDeletedEventTest < ActiveSupport::TestCase
def setup
@service = FactoryGirl.create(:service)
end
attr_reader :service
def test_destroy_service_publishes_event
service.mark_as_deleted!
event = EventStore::Event.where(event_type: 'Services::ServiceScheduledForDeletionEvent').last
assert_equal service.id, event.data[:service_id]
end
def test_after_commit_when_published
DeletePlainObjectWorker.expects(:perform_later).with do |param|
param.kind_of?(Service) && param.id == service.id
end
event = Services::ServiceScheduledForDeletionEvent.create(service)
Rails.application.config.event_store.publish_event(event)
end
end And btw, it should be About those tests, you will see the 1st one passes and the 2nd one fails. So I think the problem is the So I think we do it with a subscriber instead of the
|
87495fb
to
0457254
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 😍 Thanks! 🥇 💪 💃
0457254
to
6c6676c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! 🥇 💪
related https://github.com/3scale/porta/issues/20