Skip to content

Commit

Permalink
2022.05.12:
Browse files Browse the repository at this point in the history
* new: bash/cache/accum-content.sh: added check of `NO_SKIP_UNEXPIRED_ENTRIES` to avoid skip of not yet expired files and force to download them
  • Loading branch information
andry81 committed May 12, 2022
1 parent cd154f1 commit a2943ad
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
28 changes: 16 additions & 12 deletions bash/cache/accum-content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -277,23 +277,27 @@ for i in $("${YQ_CMDLINE_READ[@]}" '."content-config".entries[0].dirs|keys|.[]'
fi
if (( ! is_file_expired )); then
echo "File is skipped: prev-timestamp=\`$index_file_prev_timestamp\` sched-timestamp=\`$config_sched_next_update_timestamp_utc\` expired-delta=\`$index_file_expired_timestamp_delta\` existed=\`$is_index_file_prev_exist\` file=\`$index_dir/$index_file\`"
if (( ! NO_SKIP_UNEXPIRED_ENTRIES )); then
echo "File is skipped: prev-timestamp=\`$index_file_prev_timestamp\` sched-timestamp=\`$config_sched_next_update_timestamp_utc\` expired-delta=\`$index_file_expired_timestamp_delta\` existed=\`$is_index_file_prev_exist\` file=\`$index_dir/$index_file\`"
# update existing file hash on skip
if [[ -n "$index_file_next_md5_hash" && "$index_file_next_md5_hash" != "$index_file_prev_md5_hash" ]]; then
index_file_next_timestamp="$(date --utc +%FT%TZ)"
# update existing file hash on skip
if [[ -n "$index_file_next_md5_hash" && "$index_file_next_md5_hash" != "$index_file_prev_md5_hash" ]]; then
index_file_next_timestamp="$(date --utc +%FT%TZ)"
yq_edit 'content-index' "$content_index_file" "$TEMP_DIR/content-index-[$i][$j]-edited.yml" \
".\"content-index\".entries[0].dirs[$i].files[$j].\"md5-hash\"=\"$index_file_next_md5_hash\"" && \
yq_diff "$content_index_file" "$TEMP_DIR/content-index-[$i][$j]-edited.yml" "$TEMP_DIR/content-index-[$i][$j]-edited.diff" && \
yq_patch "$content_index_file" "$TEMP_DIR/content-index-[$i][$j]-edited.diff" "$TEMP_DIR/content-index-[$i][$j].yml" "$content_index_file"
yq_edit 'content-index' "$content_index_file" "$TEMP_DIR/content-index-[$i][$j]-edited.yml" \
".\"content-index\".entries[0].dirs[$i].files[$j].\"md5-hash\"=\"$index_file_next_md5_hash\"" && \
yq_diff "$content_index_file" "$TEMP_DIR/content-index-[$i][$j]-edited.yml" "$TEMP_DIR/content-index-[$i][$j]-edited.diff" && \
yq_patch "$content_index_file" "$TEMP_DIR/content-index-[$i][$j]-edited.diff" "$TEMP_DIR/content-index-[$i][$j].yml" "$content_index_file"
echo '---'
fi
echo '---'
fi
(( stats_skipped_inc++ ))
(( stats_skipped_inc++ ))
continue
continue
else
echo "File is forced to download: prev-timestamp=\`$index_file_prev_timestamp\` sched-timestamp=\`$config_sched_next_update_timestamp_utc\` expired-delta=\`$index_file_expired_timestamp_delta\` existed=\`$is_index_file_prev_exist\` file=\`$index_dir/$index_file\`"
fi
else
(( stats_expired_inc++ ))
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2022.05.12:
* new: bash/cache/accum-content.sh: added check of `NO_SKIP_UNEXPIRED_ENTRIES` to avoid skip of not yet expired files and force to download them

2022.05.11:
* fixed: bash/inpage/accum-downloads.sh: save into `by_year` json file relative `downloads` counter instead of absolute
* fixed: bash/boards/accum-stats.sh: save into `by_year` json file relative `downloads` counter instead of absolute
Expand Down
3 changes: 3 additions & 0 deletions userlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
> :warning: to find all changes use [changelog.txt](https://github.com/andry81-devops/gh-workflow/blob/master/changelog.txt) file in a directory
## 2022.05.12:
* new: bash/cache/accum-content.sh: added check of `NO_SKIP_UNEXPIRED_ENTRIES` to avoid skip of not yet expired files and force to download them

## 2022.05.11:
* fixed: bash/inpage/accum-downloads.sh: save into `by_year` json file relative `downloads` counter instead of absolute
* fixed: bash/boards/accum-stats.sh: save into `by_year` json file relative `downloads` counter instead of absolute
Expand Down

0 comments on commit a2943ad

Please sign in to comment.