Skip to content

Commit

Permalink
minor changes to work with gen_schedule from scheduler-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mmccrackan committed Jan 30, 2025
1 parent a472a96 commit e3fbfa6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/scheduler_server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_preset_config(preset_name, default={}):
'fields': 'program,from,to,config,status'
}
}

presets = {
'rest.satp1': {
'url': os.environ['NOCODB_SATP1_URL'],
Expand Down
4 changes: 2 additions & 2 deletions src/scheduler_server/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def rest_handler(t0, t1, policy_config={}):

if len(plans_overlap) == 0:
raise ValueError("No active plan has any overlap with the requested period")

# sort to find plan with maximal overlap
best_plan = sorted(plans_overlap, key=lambda x: (-x[0], x[1]))[0][-1] # largest overlap and earliest in time.
logger.info(f"Best plan found: {best_plan}")
Expand Down Expand Up @@ -88,7 +88,7 @@ def rest_handler(t0, t1, policy_config={}):
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)

schedule = module.main(t0, t1, **config)
schedule = module.main(t0=t0, t1=t1, **config)

return schedule

Expand Down

0 comments on commit e3fbfa6

Please sign in to comment.