From 6c21a8f8cfa545021a2159f82cb5284edbc1bb26 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Mon, 19 Jun 2023 08:55:56 +0200 Subject: [PATCH] fix: [daterange object] fix objects by date --- bin/lib/objects/abstract_daterange_object.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/lib/objects/abstract_daterange_object.py b/bin/lib/objects/abstract_daterange_object.py index 1465c371..b96c5ec4 100755 --- a/bin/lib/objects/abstract_daterange_object.py +++ b/bin/lib/objects/abstract_daterange_object.py @@ -135,17 +135,21 @@ class AbstractDaterangeObject(AbstractObject, ABC): self.update_daterange(date) update_obj_date(date, self.type) - # Correlations - self.add_correlation(obj_type, subtype, obj_id) - if obj_type == 'item': # NB Object seen by day TODO if not self.is_correlated(obj_type, subtype, obj_id): # nb seen by day r_object.zincrby(f'{self.type}:date:{date}', 1, self.id) + + # Correlations + self.add_correlation(obj_type, subtype, obj_id) + if is_crawled(obj_id): # Domain domain = get_item_domain(obj_id) self.add_correlation('domain', '', domain) else: + # Correlations + self.add_correlation(obj_type, subtype, obj_id) + # TODO Don't increase on reprocess r_object.zincrby(f'{self.type}:date:{date}', 1, self.id) # r_object.zincrby(f'{self.type}:obj:{obj_type}', 1, self.id)