forked from ghe0/brain-mock
don't delete VMs if node is offline for < 1day
This commit is contained in:
parent
02be48fd96
commit
64b65d7ecd
@ -277,7 +277,7 @@ impl BrainData {
|
|||||||
.iter()
|
.iter()
|
||||||
.filter(|c| c.node_pubkey == node.public_key)
|
.filter(|c| c.node_pubkey == node.public_key)
|
||||||
{
|
{
|
||||||
let compensation = c.price_per_minute() * 24;
|
let compensation = c.price_per_minute() * 10;
|
||||||
if compensation < operator.escrow {
|
if compensation < operator.escrow {
|
||||||
operator.escrow -= compensation;
|
operator.escrow -= compensation;
|
||||||
self.add_nano_to_wallet(&c.admin_pubkey, compensation);
|
self.add_nano_to_wallet(&c.admin_pubkey, compensation);
|
||||||
@ -287,7 +287,7 @@ impl BrainData {
|
|||||||
}
|
}
|
||||||
// delete nodes that are offline more than 3 hours, and clean contracts
|
// delete nodes that are offline more than 3 hours, and clean contracts
|
||||||
nodes.retain(|n| {
|
nodes.retain(|n| {
|
||||||
if n.offline_minutes > 180 {
|
if n.offline_minutes > 1600 {
|
||||||
vm_contracts.retain_mut(|c| {
|
vm_contracts.retain_mut(|c| {
|
||||||
if c.node_pubkey == n.public_key {
|
if c.node_pubkey == n.public_key {
|
||||||
self.add_nano_to_wallet(&c.admin_pubkey, c.locked_nano);
|
self.add_nano_to_wallet(&c.admin_pubkey, c.locked_nano);
|
||||||
|
Loading…
Reference in New Issue
Block a user