Skip to content

Commit

Permalink
feat: ability to set timeout for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
raaymax committed Dec 16, 2024
1 parent 94f6293 commit ebbb031
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/writer/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import requests
from gitignore_parser import parse_gitignore

DEPLOY_TIMEOUT = int(os.getenv("WRITER_DEPLOY_TIMEOUT", 20))

@click.group()
def cloud():
Expand Down Expand Up @@ -261,7 +262,7 @@ def upload_package(deploy_url, tar, token, env, verbose=False, sleep_interval=5)
print("Package uploaded. Building...")
status = "WAITING"
url = ""
while status not in ["COMPLETED", "FAILED"] and datetime.now(pytz.timezone('UTC')) < build_time + timedelta(minutes=5):
while status not in ["COMPLETED", "FAILED"] and datetime.now(pytz.timezone('UTC')) < build_time + timedelta(minutes=DEPLOY_TIMEOUT):
end_time = datetime.now(pytz.timezone('UTC'))
status, url = check_service_status(deploy_url, token, build_id, build_time, start_time, end_time, status)
time.sleep(sleep_interval)
Expand Down

0 comments on commit ebbb031

Please sign in to comment.