Skip to content

Commit

Permalink
perf: Added JSON parallel processing
Browse files Browse the repository at this point in the history
  • Loading branch information
doronkg committed Jul 25, 2024
1 parent 277683d commit 4997aa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test:

sort-exception-files:
@echo "Sorting exception files..."
@find $(EXCEPTIONS_DIR) -name '$(EXCEPTIONS_FILE_PATTERN)' -exec sh -c ' \
@find $(EXCEPTIONS_DIR) -name '$(EXCEPTIONS_FILE_PATTERN)' | xargs -I{} -P 4 sh -c ' \
jq "with_entries(.value |= sort_by(.Namespace, .ResourceName))" {} > {}.tmp && mv {}.tmp {} \
' \;

Expand All @@ -40,7 +40,7 @@ validate-exception-sorting:

dedup-exception-files:
@echo "Deduplicating exception files..."
@find $(EXCEPTIONS_DIR) -type f -name '$(EXCEPTIONS_FILE_PATTERN)' -exec sh -c ' \
@find $(EXCEPTIONS_DIR) -type f -name '$(EXCEPTIONS_FILE_PATTERN)' | xargs -I{} -P 4 sh -c ' \
jq '\''keys[0] as $$key | { ($$key): (.[$$key] | group_by(.Namespace, .ResourceName) | map(.[0])) }'\'' "$$1" > "$$1.tmp" && mv "$$1.tmp" "$$1" \
' sh {} \;

Expand Down

0 comments on commit 4997aa0

Please sign in to comment.