You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2023/12/05 10:34:16 UTC
(airflow) 31/34: Avoid crushing container when directory is not found on rm (#36050)
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-8-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit a42d3d86c77e43c7a762b145cb17fb9e6c81a8f6
Author: rom sharon <33...@users.noreply.github.com>
AuthorDate: Mon Dec 4 23:50:39 2023 +0200
Avoid crushing container when directory is not found on rm (#36050)
(cherry picked from commit 61fd166a4662d67bc914949f9cf07ceab7d55686)
---
Dockerfile | 2 +-
scripts/docker/clean-logs.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 61b95f7d7c..b1ba16db53 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1174,7 +1174,7 @@ while true; do
-type f -mtime +"${RETENTION}" -name '*.log' -print0 | \
xargs -0 rm -f
- find "${DIRECTORY}"/logs -type d -empty -delete
+ find "${DIRECTORY}"/logs -type d -empty -delete || true
seconds=$(( $(date -u +%s) % EVERY))
(( seconds < 1 )) || sleep $((EVERY - seconds - 1))
diff --git a/scripts/docker/clean-logs.sh b/scripts/docker/clean-logs.sh
index 53f5407d96..df138e4a6f 100644
--- a/scripts/docker/clean-logs.sh
+++ b/scripts/docker/clean-logs.sh
@@ -35,7 +35,7 @@ while true; do
-type f -mtime +"${RETENTION}" -name '*.log' -print0 | \
xargs -0 rm -f
- find "${DIRECTORY}"/logs -type d -empty -delete
+ find "${DIRECTORY}"/logs -type d -empty -delete || true
seconds=$(( $(date -u +%s) % EVERY))
(( seconds < 1 )) || sleep $((EVERY - seconds - 1))