From 6461862f5c7d91f3fd99995cbbc0d5d1c6824bd7 Mon Sep 17 00:00:00 2001 From: "K.Kolotyuk" Date: Tue, 20 Sep 2016 14:51:25 +0600 Subject: [PATCH] Fix atleisure `skip_property` usage --- apps/workers/suppliers/atleisure/metadata.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/workers/suppliers/atleisure/metadata.rb b/apps/workers/suppliers/atleisure/metadata.rb index c4e7cedae..5d03f6bc7 100644 --- a/apps/workers/suppliers/atleisure/metadata.rb +++ b/apps/workers/suppliers/atleisure/metadata.rb @@ -39,8 +39,9 @@ def fetch_data_and_process(properties) if result.success? properties_data = result.value properties_data.map do |property| + property_id = property['HouseCode'] if validator(property).valid? - synchronisation.start(property['HouseCode']) { + synchronisation.start(property_id) { # AtLeisure's API calls return with large result payloads while # synchronising properties, therefore, event tracking is disabled # while the property is parsed. @@ -49,7 +50,7 @@ def fetch_data_and_process(properties) mapper.prepare(property) } else - synchronisation.skip_property + synchronisation.skip_property(property_id, 'Invalid property') end end else