shreeharshshinde commented on code in PR #61853:
URL: https://github.com/apache/airflow/pull/61853#discussion_r2803687948


##########
scripts/docker/clean-logs.sh:
##########
@@ -30,11 +31,19 @@ readonly EVERY=$((FREQUENCY*60))
 echo "Cleaning logs every $EVERY seconds"
 
 while true; do
-  echo "Trimming airflow logs to ${RETENTION} days."
-  find "${DIRECTORY}"/logs \
-    -type d -name 'lost+found' -prune -o \
-    -type f -mtime +"${RETENTION}" -name '*.log' -print0 | \
-    xargs -0 rm -f || true
+  if [[ -n "${RETENTION_MINUTES}" ]]; then
+    echo "Trimming airflow logs older than ${RETENTION_MINUTES} minutes."
+    find "${DIRECTORY}"/logs \
+      -type d -name 'lost+found' -prune -o \
+      -type f -mmin +"${RETENTION_MINUTES}" -name '*.log' -print0 | \
+      xargs -0 rm -f || true
+  else
+    echo "Trimming airflow logs older than ${RETENTION_DAYS} days."
+    find "${DIRECTORY}"/logs \
+      -type d -name 'lost+found' -prune -o \
+      -type f -mtime +"${RETENTION_DAYS}" -name '*.log' -print0 | \
+      xargs -0 rm -f || true
+  fi

Review Comment:
   that makes sense, combining both values into a single minute-based retention 
avoids silent overrides and simplifies the logic.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to