TNO Intern

Commit f2d41cd0 authored by Arjo Segers's avatar Arjo Segers
Browse files

Increase delay when inquiry fails.

parent 6d08f192
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@
#
# 2026-04, Arjo Segers
#   Fixed definition of bounding box for global selection.
#   Added delays to avoid rate limit errors from STAC catalogue inquiry.
#   Added increasing delays to avoid rate limit errors from STAC catalogue inquiry.
#


@@ -340,6 +340,7 @@ class CSO_DataSpace_Inquire(utopya.UtopyaRc):
            maxtry = 10
            ntry = 1
            nsec_wait = 5
            nsec_wait_max = 600
            # loop until success or too many errors:
            while True:
                # until success:
@@ -429,6 +430,8 @@ class CSO_DataSpace_Inquire(utopya.UtopyaRc):
                        time.sleep(nsec_wait)
                        ntry += 1
                        logging.warning(f"{indent}    attempt {ntry} / {maxtry} ...")
                        # next time, wait a bit longer, but not too long ...
                        nsec_wait = min(nsec_wait * 2, nsec_wait_max)
                    # endif
                # endtry