Remove check for payments while processing undeployment requests

This commit is contained in:
Adw8 2024-10-29 09:25:06 +05:30
parent 5f8e809b2d
commit 1f41c1b1e1

View File

@ -25,7 +25,6 @@ from stack_orchestrator.deploy.webapp.util import (
LaconicRegistryClient, LaconicRegistryClient,
match_owner, match_owner,
skip_by_tag, skip_by_tag,
confirm_payment,
) )
main_logger = TimedLogger(file=sys.stderr) main_logger = TimedLogger(file=sys.stderr)
@ -281,7 +280,7 @@ def command( # noqa: C901
else: else:
one_per_deployment[r.attributes.deployment] = r one_per_deployment[r.attributes.deployment] = r
requests_to_check_for_payment = [] requests_to_execute = []
for r in one_per_deployment.values(): for r in one_per_deployment.values():
try: try:
if r.attributes.deployment not in named_deployments: if r.attributes.deployment not in named_deployments:
@ -306,7 +305,7 @@ def command( # noqa: C901
else: else:
if r.id not in previous_requests: if r.id not in previous_requests:
main_logger.log(f"Request {r.id} needs to processed.") main_logger.log(f"Request {r.id} needs to processed.")
requests_to_check_for_payment.append(r) requests_to_execute.append(r)
else: else:
main_logger.log( main_logger.log(
f"Skipping unsatisfied request {r.id} because we have seen it before." f"Skipping unsatisfied request {r.id} because we have seen it before."
@ -314,26 +313,6 @@ def command( # noqa: C901
except Exception as e: except Exception as e:
main_logger.log(f"ERROR examining {r.id}: {e}") main_logger.log(f"ERROR examining {r.id}: {e}")
requests_to_execute = []
# TODO: Handle requests with auction
if min_required_payment:
for r in requests_to_check_for_payment:
main_logger.log(f"{r.id}: Confirming payment...")
if confirm_payment(
laconic,
r,
payment_address,
min_required_payment,
main_logger,
):
main_logger.log(f"{r.id}: Payment confirmed.")
requests_to_execute.append(r)
else:
main_logger.log(f"Skipping request {r.id}: unable to verify payment.")
dump_known_requests(state_file, [r])
else:
requests_to_execute = requests_to_check_for_payment
main_logger.log( main_logger.log(
"Found %d unsatisfied request(s) to process." % len(requests_to_execute) "Found %d unsatisfied request(s) to process." % len(requests_to_execute)
) )