Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- old_provider = restream.provider
- new_provider = ProviderType1.new old_provider.params_hash
- if new_provider.initialize_event == ProviderType1.SUCCESS_CODE
- # use buy-bug to check if #initialize_event was successful
- new_provider.save
- # check if new_provider can be persisted or have validation errors with "puts new_provider.errors"
- old_provider.destroy
- # restream should have nullified its provider automatically after it was destroyed. check here
- restream.provider = new_provider
- restream.save
- # check if restream.provider is the new_provider
- end
- # If you manage to get the right provider after this, there's a chance you're investigating the wrong restream on your worker. Are you sure it's always supposed to be `channel.restreams.last` ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement