Skip to content

Commit

Permalink
Fixes to calling the stacking task converting the context.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccully committed Mar 22, 2024
1 parent c5f6d84 commit b00844d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions banzai_floyds/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from banzai.utils.date_utils import TIMESTAMP_FORMAT
import datetime
from astropy.time import Time
from banzai.context import Context


logger = logging.getLogger('banzai')
Expand Down Expand Up @@ -60,8 +61,13 @@ def populate_photometric_standards():

@app.task(name='celery.stack_flats', reject_on_worker_lost=True, max_retries=5)
def stack_flats_task(min_date, max_date, instrument_id, runtime_context):
instrument = banzai.dbs.get_instrument_by_id(instrument_id, db_address=runtime_context.db_address)
calibrations.make_master_calibrations(instrument, 'LAMPFLAT', min_date, max_date, runtime_context)
try:
runtime_context = Context(runtime_context)
instrument = banzai.dbs.get_instrument_by_id(instrument_id, db_address=runtime_context.db_address)
calibrations.make_master_calibrations(instrument, 'LAMPFLAT', min_date, max_date, runtime_context)
except Exception:
logger.error("Exception processing frame: {error}".format(error=logs.format_exception()),
extra_tags={'instrument_id': instrument_id, 'min_date': min_date, 'max_date': max_date})


def banzai_floyds_stack_flats():
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/banzai-floyds/templates/workers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
command:
- "celery"
- "-A"
- "banzai"
- "banzai_floyds.main:app"
- "worker"
- "--concurrency"
- "1"
Expand Down

0 comments on commit b00844d

Please sign in to comment.