Skip to content

Commit

Permalink
deleted state check added for pause services on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
solarw committed Jun 18, 2024
1 parent ab5347d commit cbdf9ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions operate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from operate.account.user import UserAccount
from operate.constants import KEY, KEYS, OPERATE, SERVICES
from operate.ledger import get_ledger_type_from_chain_type
from operate.types import ChainType
from operate.types import ChainType, DeploymentStatus
from operate.wallet.master import MasterWalletManager


Expand Down Expand Up @@ -186,8 +186,10 @@ def pause_all_services_on_startup():
for service in services:
if not operate.service_manager().exists(service=service):
continue
logger.info(f"stopping service {service}")
deployment = operate.service_manager().create_or_load(service).deployment
if deployment.status == DeploymentStatus.DELETED:
continue
logger.info(f"stopping service {service}")
deployment.stop(force=True)
logger.info(f"Cancelling funding job for {service}")
cancel_funding_job(service=service)
Expand Down

0 comments on commit cbdf9ff

Please sign in to comment.