fix: [Indexer] debug messages

This commit is contained in:
Terrtia 2021-04-02 17:20:03 +02:00
parent 2cd6354351
commit cb4d901be3
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -101,14 +101,14 @@ class Indexer(AbstractModule):
PST = Paste.Paste(message) PST = Paste.Paste(message)
docpath = message.split(" ", -1)[-1] docpath = message.split(" ", -1)[-1]
paste = PST.get_p_content() paste = PST.get_p_content()
self.redis_logger.debug("Indexing - " + self.indexname + " :", docpath) self.redis_logger.debug(f"Indexing - {self.indexname}: {docpath}")
# Avoid calculating the index's size at each message # Avoid calculating the index's size at each message
if(time.time() - self.last_refresh > self.TIME_WAIT): if(time.time() - self.last_refresh > self.TIME_WAIT):
self.last_refresh = time.time() self.last_refresh = time.time()
if self.check_index_size() >= self.INDEX_SIZE_THRESHOLD*(1000*1000): if self.check_index_size() >= self.INDEX_SIZE_THRESHOLD*(1000*1000):
timestamp = int(time.time()) timestamp = int(time.time())
self.redis_logger.debug("Creating new index", timestamp) self.redis_logger.debug(f"Creating new index {timestamp}")
self.indexpath = join(self.baseindexpath, str(timestamp)) self.indexpath = join(self.baseindexpath, str(timestamp))
self.indexname = str(timestamp) self.indexname = str(timestamp)
# update all_index # update all_index
@ -127,7 +127,7 @@ class Indexer(AbstractModule):
indexwriter.commit() indexwriter.commit()
except IOError: except IOError:
self.redis_logger.debug("CRC Checksum Failed on :", PST.p_path) self.redis_logger.debug(f"CRC Checksum Failed on: {PST.p_path}")
self.redis_logger.error('Duplicate;{};{};{};CRC Checksum Failed'.format( self.redis_logger.error('Duplicate;{};{};{};CRC Checksum Failed'.format(
PST.p_source, PST.p_date, PST.p_name)) PST.p_source, PST.p_date, PST.p_name))