fix: delete unpaid only if created and expires timestamp are the same
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -196,7 +196,8 @@ impl Worker {
|
|||||||
self.check_vm(vm).await?;
|
self.check_vm(vm).await?;
|
||||||
|
|
||||||
// delete vm if not paid (in new state)
|
// delete vm if not paid (in new state)
|
||||||
if vm.expires < Utc::now().sub(Days::new(1)) {
|
if vm.created == vm.expires && !vm.deleted && vm.expires < Utc::now().sub(Days::new(1))
|
||||||
|
{
|
||||||
info!("Deleting unpaid VM {}", vm.id);
|
info!("Deleting unpaid VM {}", vm.id);
|
||||||
self.provisioner.delete_vm(vm.id).await?;
|
self.provisioner.delete_vm(vm.id).await?;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user