Class: Contentful::Scheduler::Controller
- Inherits:
-
Webhook::Listener::Controllers::WebhookAware
- Object
- Webhook::Listener::Controllers::WebhookAware
- Contentful::Scheduler::Controller
- Defined in:
- lib/contentful/scheduler/controller.rb
Instance Method Summary collapse
- #create ⇒ Object (also: #save, #auto_save, #unarchive)
- #delete ⇒ Object (also: #unpublish, #archive, #publish)
Instance Method Details
#create ⇒ Object Also known as: save, auto_save, unarchive
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/contentful/scheduler/controller.rb', line 8 def create return unless webhook.entry? if !Auth.new(webhook).auth logger.warn "Skipping - Authentication failed for Space: #{webhook.space_id} - Entry: #{webhook.id}" return end logger.info "Queueing - Space: #{webhook.space_id} - Entry: #{webhook.id}" Queue.instance(logger).update_or_create(webhook) end |
#delete ⇒ Object Also known as: unpublish, archive, publish
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/contentful/scheduler/controller.rb', line 24 def delete return unless webhook.entry? if !Auth.new(webhook).auth logger.warn "Skipping - Authentication failed for Space: #{webhook.space_id} - Entry: #{webhook.id}" return end logger.info "Unqueueing - Space: #{webhook.space_id} - Entry: #{webhook.id}" Queue.instance(logger).remove(webhook) end |