fix: [daterange object] fix objects by date

This commit is contained in:
Terrtia 2023-06-19 08:55:56 +02:00
parent b4d3c6256d
commit 6c21a8f8cf
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -135,17 +135,21 @@ class AbstractDaterangeObject(AbstractObject, ABC):
self.update_daterange(date) self.update_daterange(date)
update_obj_date(date, self.type) update_obj_date(date, self.type)
# Correlations
self.add_correlation(obj_type, subtype, obj_id)
if obj_type == 'item': if obj_type == 'item':
# NB Object seen by day TODO # NB Object seen by day TODO
if not self.is_correlated(obj_type, subtype, obj_id): # nb seen by day 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) 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 if is_crawled(obj_id): # Domain
domain = get_item_domain(obj_id) domain = get_item_domain(obj_id)
self.add_correlation('domain', '', domain) self.add_correlation('domain', '', domain)
else: else:
# Correlations
self.add_correlation(obj_type, subtype, obj_id)
# TODO Don't increase on reprocess # TODO Don't increase on reprocess
r_object.zincrby(f'{self.type}:date:{date}', 1, self.id) r_object.zincrby(f'{self.type}:date:{date}', 1, self.id)
# r_object.zincrby(f'{self.type}:obj:{obj_type}', 1, self.id) # r_object.zincrby(f'{self.type}:obj:{obj_type}', 1, self.id)