Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix forge bugs #162

Merged
merged 6 commits into from
Jul 31, 2024
Merged

Fix forge bugs #162

merged 6 commits into from
Jul 31, 2024

Conversation

wkpark
Copy link
Owner

@wkpark wkpark commented Jul 30, 2024

fix issue #161

def url_ok(url: str) -> bool:
    try:
        for _ in range(5):
            with warnings.catch_warnings():
                warnings.filterwarnings("ignore")
                r = httpx.head(url, timeout=30, verify=False) # <=== increase timeout ~10~30
                #r = httpx.head(url, timeout=3, verify=False)
            if r.status_code in (200, 401, 302):  # 401 or 302 if auth is set
                return True
            time.sleep(0.500)
    except (ConnectionError, httpx.ConnectError):
        return False
    return False

@wkpark wkpark self-assigned this Jul 30, 2024
@wkpark wkpark added the bug Something isn't working label Jul 30, 2024
@wkpark wkpark changed the base branch from master to dev July 31, 2024 13:45
@wkpark wkpark merged commit 261fa7a into dev Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant