Skip to content

Commit

Permalink
Merge e5026f5 into master-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 11, 2022
2 parents 38d2cbf + e5026f5 commit e0990cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions bb_billing/views/views_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ def invoice_event(request):
if customer.threshold < 1000.00:
owned_bricks = VirtualBrickOwner.objects.filter(owner=customer)
for brick in owned_bricks:
pause_vm_subprocess.apply_async(
(brick.virt_brick.id,),
queue='ssh_queue'
)
brick.virt_brick.is_on=False
brick.virt_brick.save()
if brick.virt_brick.is_on:
pause_vm_subprocess.apply_async(
(brick.virt_brick.id,),
queue='ssh_queue'
)
brick.virt_brick.is_on=False
brick.virt_brick.save()

# -------------------------------- Destroy VMs ------------------------------- #
bill = BillingHistory.objects.get(invoice_id=invoice.id)
Expand Down
2 changes: 1 addition & 1 deletion bb_tasks/tasks/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def prepare_gpu_background_task():
'''
gpu_list = GPU.objects.all()
for gpu in gpu_list:
if not gpu.bg_ready and not gpu.rented and gpu.host.is_ready:
if not gpu.bg_ready and not gpu.rented and gpu.host.is_ready and gpu.host.is_enabled:
host = gpu.host

background_brick = box.Brick(host_port=host.ssh_port, brick_id=f'gpu_{str(gpu.id)}')
Expand Down

0 comments on commit e0990cc

Please sign in to comment.