contentful-scheduler-custom 1.5.694 → 1.5.695

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f030f0cf9a5701e5bee295d611aebb4bceb6ca3f
4
- data.tar.gz: 1414d2a695f26be3d849a07e1ae91fb95284cdb0
3
+ metadata.gz: cb7fdd599e8dd540a40bf40675b02f2d08e38d77
4
+ data.tar.gz: 468038f5f236c7ead17a776c5321ad065013ec19
5
5
  SHA512:
6
- metadata.gz: 24920e4afafb198353510bd4480297c62bd145bd2adb3e7cd8b08517fc3e7b474f68f9c205a8985d1eb529c7117225d640336c7f5ad52462c9b665b9931322c6
7
- data.tar.gz: 99ba48b36d925212220c557bd663992ac69ab64591c736229236e4683481d6b00844c9025163bfccdaaa9a07221e18298488f93248a8e55ba9aa9fc0137184eb
6
+ metadata.gz: 2b471b9a021dd0ee57a4d2c84cac351416afb87f6ae379eb88d1bea5b39667da6f76f3715232a5661ee6efcc96c2df5efa1663c69f9820c5767e3e6e97c95f2d
7
+ data.tar.gz: 7441775c374d2bff417361b65d6eeb3bd7ef29ca4f9bc77c2eada2f39639deb27083a894d963d2936edd32ee9d80453c86df1ea826b104062fc56bd6d66b37c4
@@ -85,7 +85,7 @@ module Contentful
85
85
  ::Contentful::Scheduler.config[:management_token]
86
86
  )
87
87
 
88
- removeContentBlocks(webhook, 'unpublish')
88
+ removeContentBlocksUnpublish(webhook)
89
89
 
90
90
  log_event_success(webhook, success, 'unpublish', 'removed from')
91
91
  end
@@ -187,6 +187,24 @@ module Contentful
187
187
  end
188
188
  end
189
189
 
190
+ def removeContentBlocksUnpublish(webhook)
191
+ if isContentBlockAvailable(webhook)
192
+ webhook.fields['contentBlocks']['fi-FI'].each do |sys|
193
+ success = Resque.remove_delayed(
194
+ ::Contentful::Scheduler::Tasks::Unpublish,
195
+ webhook.space_id,
196
+ sys['sys']['id'],
197
+ ::Contentful::Scheduler.config[:management_token]
198
+ )
199
+ if success
200
+ logger.info "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} successfully removed from unpublish queue"
201
+ else
202
+ logger.warn "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} couldn't be removed from unpublish queue"
203
+ end
204
+ end
205
+ end
206
+ end
207
+
190
208
  def isContentBlockAvailable(webhook)
191
209
  return !webhook.fields['contentBlocks'].nil?
192
210
  end
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module Scheduler
3
- VERSION = "1.5.694"
3
+ VERSION = "1.5.695"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-scheduler-custom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.694
4
+ version: 1.5.695
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (David Litvak Bruno0
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-16 00:00:00.000000000 Z
11
+ date: 2018-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contentful-webhook-listener