Skip to content

Commit

Permalink
Merge pull request #231 from cityofaustin/pr-in-ad-hoc-fix
Browse files Browse the repository at this point in the history
PR in two fixes which have been made in situ in production; fix knack utility and cron job definition
  • Loading branch information
frankhereford authored May 22, 2024
2 parents ece5470 + 9746029 commit 7754148
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions dags/utils/knack.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ def get_date_filter_arg(should_replace_monthly=False, **context):
Returns:
Str or None: the -d flag and ISO date string or None
"""

today = now()
prev_start_date = context.get("prev_start_date_success") or today.isoformat()
prev_start_date = context.get("prev_start_date_success") or today

if should_replace_monthly and today.day == 1:
return ""
return f"-d {prev_start_date}"

return f"-d {prev_start_date.isoformat()}"
2 changes: 1 addition & 1 deletion toolbox/log-purge/log-purge.cron
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# time greater than 30 days, and the second command removes all empty directories. Removed
# files and directories are logged into /var/log which will get rotated by the system.

0 2 * * * find /usr/airflow/atd-airflow/logs -type f -mtime +30 -exec rm -v {} \; \
0 2 * * * root find /usr/airflow/atd-airflow/logs -type f -mtime +30 -exec rm -v {} \; \
>> /var/log/airflow-logs-purge.log && \
find /usr/airflow/atd-airflow/logs -type d -empty | xargs -I {} rmdir -v {}; \
>> /var/log/airflow-logs-purge.log && \
Expand Down

0 comments on commit 7754148

Please sign in to comment.