Skip to content

Move holiday scraping out of import/build and add timeout/retries to prevent intermittent ConnectionError. #179

@Devansh-bit

Description

@Devansh-bit

Network I/O runs at import and during image build, so transient TLS resets from the holidays site abort startup or CI with requests.exceptions.ConnectionError, making builds non-deterministic. The request also lacks an explicit timeout/retry policy, so brief outages or slow servers fail hard instead of backing off and recovering.

#utils/dates.py
# module import triggers network fetch
hol_dates, holidays, hdays = get_holidates()

def get_holidates():
    url = "https://www.iitkgp.ac.in/holidays"
    result = requests.get(url).text  # no timeout/retries
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions