chg: [global module] perf

ocr
terrtia 2024-03-13 14:39:31 +01:00
parent 6f2668eff1
commit 8483272ee0
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 2 additions and 3 deletions

View File

@ -81,10 +81,9 @@ class Global(AbstractModule):
def compute(self, message, r_result=False): # TODO move OBJ ID sanitization to importer def compute(self, message, r_result=False): # TODO move OBJ ID sanitization to importer
# Recovering the streamed message infos # Recovering the streamed message infos
gzip64encoded = message
if self.obj.type == 'item': if self.obj.type == 'item':
if gzip64encoded: if message:
# Creating the full filepath # Creating the full filepath
filename = os.path.join(self.ITEMS_FOLDER, self.obj.id) filename = os.path.join(self.ITEMS_FOLDER, self.obj.id)
@ -97,7 +96,7 @@ class Global(AbstractModule):
else: else:
# Decode compressed base64 # Decode compressed base64
decoded = base64.standard_b64decode(gzip64encoded) decoded = base64.standard_b64decode(message)
new_file_content = self.gunzip_bytes_obj(filename, decoded) new_file_content = self.gunzip_bytes_obj(filename, decoded)
# TODO REWRITE ME # TODO REWRITE ME