Skip to content

Commit a3f68d6

Browse files
committed
Missed a few places the where the recipe needs generalising
1 parent 1051093 commit a3f68d6

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/murfey/server/__init__.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,7 @@ def _flush_spa_preprocessing(message: dict):
19471947
machine_config = get_machine_config(instrument_name=instrument_name)[
19481948
instrument_name
19491949
]
1950+
recipe_name = machine_config.recipes.get("em-spa-preprocess", "em-spa-preprocess")
19501951
collected_ids = murfey_db.exec(
19511952
select(
19521953
db.DataCollectionGroup,
@@ -1959,10 +1960,7 @@ def _flush_spa_preprocessing(message: dict):
19591960
.where(db.DataCollection.dcg_id == db.DataCollectionGroup.id)
19601961
.where(db.ProcessingJob.dc_id == db.DataCollection.id)
19611962
.where(db.AutoProcProgram.pj_id == db.ProcessingJob.id)
1962-
.where(
1963-
db.ProcessingJob.recipe
1964-
== machine_config.recipes.get("em-spa-preprocess", "em-spa-preprocess")
1965-
)
1963+
.where(db.ProcessingJob.recipe == recipe_name)
19661964
).one()
19671965
params = murfey_db.exec(
19681966
select(db.SPARelionParameters, db.SPAFeedbackParameters)
@@ -2003,7 +2001,7 @@ def _flush_spa_preprocessing(message: dict):
20032001
)
20042002
murfey_db.add(movie)
20052003
zocalo_message: dict = {
2006-
"recipes": ["em-spa-preprocess"],
2004+
"recipes": [recipe_name],
20072005
"parameters": {
20082006
"node_creator_queue": machine_config.node_creator_queue,
20092007
"dcid": collected_ids[1].id,
@@ -2079,6 +2077,8 @@ def _flush_tomography_preprocessing(message: dict):
20792077
)
20802078
return
20812079

2080+
recipe_name = machine_config.get("em-tomo-preprocess", "em-tomo-preprocess")
2081+
20822082
for f in stashed_files:
20832083
collected_ids = murfey_db.exec(
20842084
select(
@@ -2093,10 +2093,7 @@ def _flush_tomography_preprocessing(message: dict):
20932093
.where(db.DataCollection.tag == f.tag)
20942094
.where(db.ProcessingJob.dc_id == db.DataCollection.id)
20952095
.where(db.AutoProcProgram.pj_id == db.ProcessingJob.id)
2096-
.where(
2097-
db.ProcessingJob.recipe
2098-
== machine_config.get("em-tomo-preprocess", "em-tomo-preprocess")
2099-
)
2096+
.where(db.ProcessingJob.recipe == recipe_name)
21002097
).one()
21012098
detached_ids = [c.id for c in collected_ids]
21022099

@@ -2112,7 +2109,7 @@ def _flush_tomography_preprocessing(message: dict):
21122109
)
21132110
murfey_db.add(movie)
21142111
zocalo_message: dict = {
2115-
"recipes": ["em-tomo-preprocess"],
2112+
"recipes": [recipe_name],
21162113
"parameters": {
21172114
"node_creator_queue": machine_config.node_creator_queue,
21182115
"dcid": detached_ids[1],

0 commit comments

Comments
 (0)