Skip to content

Commit a21d9c0

Browse files
committed
cache key after message publish
1 parent fa6b7a4 commit a21d9c0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

msc-wis2node-management/msc_wis2node/publisher.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ def publish_to_wis2(self, dataset: dict, url: str) -> None:
189189
update_link = deepcopy(message['links'][0])
190190
update_link['rel'] = 'update'
191191
message['links'].append(update_link)
192-
else:
193-
self.cache.set(message['properties']['data_id'], 'published',
194-
ex=CACHE_EXPIRY_SECONDS)
195192

196193
cache = dataset.get('cache', True)
197194
if not cache:
@@ -222,6 +219,11 @@ def publish_to_wis2(self, dataset: dict, url: str) -> None:
222219
}
223220
)
224221

222+
if self.cache is not None:
223+
LOGGER.debug('Setting cache key')
224+
self.cache.set(message['properties']['data_id'], 'published',
225+
ex=CACHE_EXPIRY_SECONDS)
226+
225227
def _subtopic2dirpath(self, subtopic: str) -> str:
226228
"""
227229
Transforms AMQP subtopic to directory path

0 commit comments

Comments
 (0)