Skip to content

Commit

Permalink
On demand resources, via on-demand tags
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup committed Jun 30, 2023
1 parent 2a5b6e8 commit 063a0a5
Show file tree
Hide file tree
Showing 2 changed files with 264 additions and 34 deletions.
5 changes: 3 additions & 2 deletions resallocserver/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ def ready(self):
"""
Get ready resources, those which were never assigned or are released.
The sandbox-assigned resources are sorted above others - so they can be
re-used first.
re-used first. The query is already ordered by ID ASC.
"""
return (self.up().filter(models.Resource.ticket_id.is_(None))
.filter(models.Resource.check_failed_count==0))
.filter(models.Resource.check_failed_count==0)
.order_by(models.Resource.id.asc()))

def taken(self):
"""
Expand Down
Loading

0 comments on commit 063a0a5

Please sign in to comment.