diff --git a/RundeckLogfileCleanup.py b/RundeckLogfileCleanup.py index 21bfb74..0aa2bfa 100644 --- a/RundeckLogfileCleanup.py +++ b/RundeckLogfileCleanup.py @@ -136,7 +136,7 @@ def check_deletion(execid_dates): page = 0 deleteable = () more = True - while more : + while ( more and len(deleteable)< PROPERTIES['MAX_DELETE'] ) : try: execution_root = get_executions_for_job(jobid,page) print " Page {0} got {1} jobs".format(page,execution_root.attrib['count']) diff --git a/properties.json b/properties.json index d639a1f..887f371 100644 --- a/properties.json +++ b/properties.json @@ -8,5 +8,6 @@ "MAXIMUM_DAYS": 90, "TIMEOUT": 60, "DELETE_TIMEOUT": 1200, + "MAX_DELETE": 2500, "VERBOSE": false }