contentful-scheduler-custom 1.5.6997 → 1.5.6998
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 +4 -4
- data/lib/contentful/scheduler/queue.rb +4 -25
- data/lib/contentful/scheduler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86c6a2d1c0f6c25b97ca779ca86b6fc9100fc396
|
4
|
+
data.tar.gz: 0ee139fb3cca9d88b024025bcd119cf32e2a7b12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5963277b18d55f8845329987f34328769206fa6212b0205162be60935962c6ed075a77f602c09f308718be9ea545fea224dcf9722307f4ac7d97606c956205ab
|
7
|
+
data.tar.gz: 9853317f5b5cce0f88735535d7fac5bb001ad9d833ad754ce8ebc0378f3a7b755f0fd000ee913b0abdffdcd0eed0335423fe33c8d7c2a72f0c247eba4f547912
|
@@ -62,8 +62,6 @@ module Contentful
|
|
62
62
|
return unless publishable?(webhook)
|
63
63
|
return unless in_publish_queue?(webhook)
|
64
64
|
|
65
|
-
removeContentBlocks(webhook, 'publish')
|
66
|
-
|
67
65
|
success = Resque.remove_delayed(
|
68
66
|
::Contentful::Scheduler::Tasks::Publish,
|
69
67
|
webhook.space_id,
|
@@ -71,6 +69,8 @@ module Contentful
|
|
71
69
|
::Contentful::Scheduler.config[:management_token]
|
72
70
|
)
|
73
71
|
|
72
|
+
removeContentBlocks(webhook, 'publish')
|
73
|
+
|
74
74
|
log_event_success(webhook, success, 'publish', 'removed from')
|
75
75
|
end
|
76
76
|
|
@@ -78,8 +78,6 @@ module Contentful
|
|
78
78
|
return unless unpublishable?(webhook)
|
79
79
|
return unless in_unpublish_queue?(webhook)
|
80
80
|
|
81
|
-
removeContentBlocks(webhook, 'unpublish')
|
82
|
-
|
83
81
|
success = Resque.remove_delayed(
|
84
82
|
::Contentful::Scheduler::Tasks::Unpublish,
|
85
83
|
webhook.space_id,
|
@@ -87,6 +85,8 @@ module Contentful
|
|
87
85
|
::Contentful::Scheduler.config[:management_token]
|
88
86
|
)
|
89
87
|
|
88
|
+
removeContentBlocks(webhook, 'unpublish')
|
89
|
+
|
90
90
|
log_event_success(webhook, success, 'unpublish', 'removed from')
|
91
91
|
end
|
92
92
|
|
@@ -187,27 +187,6 @@ module Contentful
|
|
187
187
|
end
|
188
188
|
end
|
189
189
|
|
190
|
-
def removeContentBlocksUnpublish(webhook)
|
191
|
-
logger.info "Inside remove CB Unpublish"
|
192
|
-
if isContentBlockAvailable(webhook)
|
193
|
-
logger.info "Inside remove CB Unpublish if block"
|
194
|
-
webhook.fields['contentBlocks']['fi-FI'].each do |sys|
|
195
|
-
logger.info "Inside remove CB Unpublish if block foreach loop"
|
196
|
-
success = Resque.remove_delayed(
|
197
|
-
::Contentful::Scheduler::Tasks::Unpublish,
|
198
|
-
webhook.space_id,
|
199
|
-
sys['sys']['id'],
|
200
|
-
::Contentful::Scheduler.config[:management_token]
|
201
|
-
)
|
202
|
-
if success
|
203
|
-
logger.info "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} successfully removed from unpublish queue"
|
204
|
-
else
|
205
|
-
logger.warn "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} couldn't be removed from unpublish queue"
|
206
|
-
end
|
207
|
-
end
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
190
|
def isContentBlockAvailable(webhook)
|
212
191
|
return !webhook.fields['contentBlocks'].nil?
|
213
192
|
end
|