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 Aug 2, 2023
1 parent d8fbec4 commit f4f3bab
Show file tree
Hide file tree
Showing 2 changed files with 262 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 f4f3bab

Please sign in to comment.