try with more cores

This commit is contained in:
Pablo Martin 2025-03-20 13:17:05 +01:00
parent 00ea2ff146
commit fa914e8e26

View file

@ -25,7 +25,6 @@ check_sql() {
# Run sqlfluff parse on the file and capture the output
OUTPUT=$(sqlfluff parse --dialect postgres "$sql_file" 2>&1)
echo "Output"
# Check if the output contains a parsing error
if echo "$OUTPUT" | grep -q "==== parsing violations ===="; then
echo "Error in file: $sql_file"
@ -38,7 +37,7 @@ check_sql() {
export -f check_sql
# Run in parallel (adjust `-P` to change concurrency level)
find "$SQL_DIR" -type f -name "*.sql" | xargs -P 4 -I {} bash -c 'check_sql "$@"' _ {}
find "$SQL_DIR" -type f -name "*.sql" | xargs -P 8 -I {} bash -c 'check_sql "$@"' _ {}
# Check exit status of xargs
if [ $? -ne 0 ]; then