Skip to content

Commit

Permalink
Revert "Fix for null values in instrument and instrument size"
Browse files Browse the repository at this point in the history
This reverts commit 66bbe89.
  • Loading branch information
mgdaily committed Jan 29, 2024
1 parent 66bbe89 commit 3d608b6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions banzai/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ def get_consumers(self, Consumer, channel):

def on_message(self, body, message):
instrument = LCOFrameFactory.get_instrument_from_header(body, self.runtime_context.db_address)
queue_name = self.runtime_context.CELERY_TASK_QUEUE_NAME
try:
if instrument.nx * instrument.ny > self.runtime_context.LARGE_WORKER_THRESHOLD:
queue_name = self.runtime_context.LARGE_WORKER_QUEUE
except Exception as e:
logger.warning(f"Instrument not found in DB, or instrument size not defined: {e}", extra_tags={'instrument': body.get('INSTRUME')})

if instrument is None or instrument.nx is None:
queue_name = self.runtime_context.CELERY_TASK_QUEUE_NAME
elif instrument.nx * instrument.ny > self.runtime_context.LARGE_WORKER_THRESHOLD:
queue_name = self.runtime_context.LARGE_WORKER_QUEUE
else:
queue_name = self.runtime_context.CELERY_TASK_QUEUE_NAME
process_image.apply_async(args=(body, vars(self.runtime_context)),
queue=queue_name)
message.ack() # acknowledge to the sender we got this message (it can be popped)
Expand Down

0 comments on commit 3d608b6

Please sign in to comment.