diff --git a/src/core/pyros_django/scheduling/A_Scheduler.py b/src/core/pyros_django/scheduling/A_Scheduler.py index 6bdaa99..75975bb 100755 --- a/src/core/pyros_django/scheduling/A_Scheduler.py +++ b/src/core/pyros_django/scheduling/A_Scheduler.py @@ -223,10 +223,12 @@ class A_Scheduler(Agent): """ - def update_db_quota_sequence(sequence, quota_attributes, id_period, night_id, d_total=sequence_info['duration']): - sequence_quota = sequence.quota - sp_quota = sequence.scientific_program - institute_quota = + def update_db_quota_sequence(sequence_id, quota_attributes): + sequence = Sequence.objects.get(id=sequence_id) + new_quota = Quota() + new_quota.set_attributes_and_save(quota_attributes) + sequence.quota = new_quota + sequence.save() def _compute_schedule_1(self): """Simple scheduler based on selection-insertion one state algorithm. @@ -346,7 +348,10 @@ class A_Scheduler(Agent): if scientific_program_id not in scientific_program_ids: scientific_program_ids.append(scientific_program_id) # --- TODO - # update_db_quota_sequence( id_period, night_id, d_total=sequence_info['duration'] ) + quota_attributes = {} + quota_attributes["total"] = sequence_info["duration"] + quota_attributes["schedule"] = sequence_info["duration"] + update_db_quota_sequence(sequence_info["id"], quota_attributes) else: sequence_info['error'] = f"File {ephfile} not exists" sequence_infos.append(sequence_info) -- libgit2 0.21.2