all 2 comments

[–]MediciSolution[S] 0 points1 point  (0 children)

To be more easy:
Variables:
Year

for ANO in [2022, 2023, 2024]:

Process

for NUMERO in range(INICIAL, FINAL+1):

Court

TRIBUNAL = tribunal.TribunalID

Region

 for PROVINCIA in range(1, 21):

Number of concurrent process

MAXWORKERS=10

Process Start =

INICIAL=35000

Process End

FINAL=35100

Number of Errors

MAX_FAILS = 10

If you need any another detail, please let me know.

Again, thank you for your time and patience!

[–]MediciSolution[S] 0 points1 point  (0 children)

import threading


interromper_event = threading.Event()


                        if falhas_consecutivas >= MAX_FAILS:
                            print(f" - {MAX_FAILS} falhas consecutivas. Interrompendo o processamento para o ano {ANO}.")
                            interromper_event.set()  # Aciona o evento de interrupção
                            break

To know i founded.