Skip to content
Snippets Groups Projects

[webservice] Select partition based on beamtime dates

Merged Cyril Danilevski requested to merge feat/proposal_date_slurm_partition into master
+ 2
4
@@ -550,9 +550,6 @@ async def get_slurm_partition(
# | CLO | Closed | Data fully migrated to dCACHE |
# |------|--------------|----------------------------------------|
# A proposal can have several beamtimes during which data can be taken,
# which are independent from the start and end dates.
loop = get_event_loop()
response = await shield(
@@ -577,6 +574,8 @@ async def get_slurm_partition(
if status_beamtime in ['R', 'A']:
partition = 'upex-high' if action == 'dark' else 'upex-middle'
# A proposal can have several beamtimes during which data can be taken
# that are independent from the start and end dates.
beamtimes = response.json().get('beamtimes', [])
active_now = False
now = datetime.now().timestamp()
@@ -588,7 +587,6 @@ async def get_slurm_partition(
break
partition = partition if active_now else 'exfel'
# NOTE: non-zero at cycle index 4 (`str(cycle)[4]`) indicates commissioning
if run_id and cycle and str(cycle)[4] != '0':
response_run = await shield(
Loading