contentful-scheduler-custom 1.5.4 → 1.5.5
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 +10 -10
- 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: 488a4c42e0d829618efde8fdaf18953c81bafe63
|
4
|
+
data.tar.gz: 0c92afbe94d2639d6dd1e9e9618224cdfb1850db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf1e2dc8b595901ee953edafd1e58ae965230791e32f0faf9a64aae8fd3451107c63aea1889923ace033381ab9458ca39e21b8ccb3bf88593d83c71e740c7043
|
7
|
+
data.tar.gz: 6ef9ca2783f080851ef7d122c0cee760f362cea97f4b384bb13407101a2695991fb6624510ab0c552b4286548bc4ab366d3890d3484682a2c74906eb1402d1c7
|
@@ -16,14 +16,14 @@ module Contentful
|
|
16
16
|
def update_or_create(webhook)
|
17
17
|
if publishable?(webhook)
|
18
18
|
success = update_or_create_for_publish(webhook)
|
19
|
-
log_event_success(webhook, success, 'publish', 'added to')
|
20
19
|
updateContentBlocks(webhook, 'publish')
|
20
|
+
log_event_success(webhook, success, 'publish', 'added to')
|
21
21
|
end
|
22
22
|
|
23
23
|
if unpublishable?(webhook)
|
24
24
|
success = update_or_create_for_unpublish(webhook)
|
25
|
-
log_event_success(webhook, success, 'unpublish', 'added to')
|
26
25
|
updateContentBlocks(webhook, 'unpublish')
|
26
|
+
log_event_success(webhook, success, 'unpublish', 'added to')
|
27
27
|
end
|
28
28
|
|
29
29
|
end
|
@@ -70,7 +70,7 @@ module Contentful
|
|
70
70
|
::Contentful::Scheduler.config[:management_token]
|
71
71
|
)
|
72
72
|
|
73
|
-
removeContentBlocks(webhook)
|
73
|
+
removeContentBlocks(webhook, 'publish')
|
74
74
|
|
75
75
|
log_event_success(webhook, success, 'publish', 'removed from')
|
76
76
|
end
|
@@ -86,9 +86,9 @@ module Contentful
|
|
86
86
|
::Contentful::Scheduler.config[:spaces][webhook.space_id][:management_token]
|
87
87
|
)
|
88
88
|
if success
|
89
|
-
logger.info "Webhook Content block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} successfully added to queue"
|
89
|
+
logger.info "Webhook Content block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} successfully added to " + type + " queue"
|
90
90
|
else
|
91
|
-
logger.warn "Webhook Content block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} couldn't be added to queue"
|
91
|
+
logger.warn "Webhook Content block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} couldn't be added to " + type + " queue"
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
@@ -102,19 +102,19 @@ module Contentful
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
def removeContentBlocks(webhook)
|
105
|
+
def removeContentBlocks(webhook, type)
|
106
106
|
if isContentBlockAvailable(webhook)
|
107
107
|
webhook.fields['contentBlocks']['fi-FI'].each do |sys|
|
108
108
|
success = Resque.remove_delayed(
|
109
|
-
|
109
|
+
getScheduleType(type),
|
110
110
|
webhook.space_id,
|
111
111
|
sys['sys']['id'],
|
112
112
|
::Contentful::Scheduler.config[:management_token]
|
113
113
|
)
|
114
114
|
if success
|
115
|
-
logger.info "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} successfully removed from queue"
|
115
|
+
logger.info "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} successfully removed from " + type + " queue"
|
116
116
|
else
|
117
|
-
logger.warn "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} couldn't be removed from queue"
|
117
|
+
logger.warn "Webhook Content Block {id: #{sys['sys']['id']}, space_id: #{webhook.space_id}} couldn't be removed from " + type + " queue"
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
@@ -155,7 +155,7 @@ module Contentful
|
|
155
155
|
::Contentful::Scheduler.config[:management_token]
|
156
156
|
)
|
157
157
|
|
158
|
-
removeContentBlocks(webhook)
|
158
|
+
removeContentBlocks(webhook, 'unpublish')
|
159
159
|
|
160
160
|
log_event_success(webhook, success, 'unpublish', 'removed from')
|
161
161
|
end
|