mirror of
https://github.com/langgenius/dify.git
synced 2025-12-19 17:27:16 -05:00
fix: determine cpu cores determination in baseedpyright-check script on macos (#28058)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def is_db_command():
|
def is_db_command() -> bool:
|
||||||
if len(sys.argv) > 1 and sys.argv[0].endswith("flask") and sys.argv[1] == "db":
|
if len(sys.argv) > 1 and sys.argv[0].endswith("flask") and sys.argv[1] == "db":
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -8,9 +8,14 @@ cd "$SCRIPT_DIR/.."
|
|||||||
# Get the path argument if provided
|
# Get the path argument if provided
|
||||||
PATH_TO_CHECK="$1"
|
PATH_TO_CHECK="$1"
|
||||||
|
|
||||||
# run basedpyright checks
|
# Determine CPU core count based on OS
|
||||||
if [ -n "$PATH_TO_CHECK" ]; then
|
CPU_CORES=$(
|
||||||
uv run --directory api --dev -- basedpyright --threads $(nproc) "$PATH_TO_CHECK"
|
if [[ "$(uname -s)" == "Darwin" ]]; then
|
||||||
else
|
sysctl -n hw.ncpu 2>/dev/null
|
||||||
uv run --directory api --dev -- basedpyright --threads $(nproc)
|
else
|
||||||
fi
|
nproc
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
|
||||||
|
# Run basedpyright checks
|
||||||
|
uv run --directory api --dev -- basedpyright --threads "$CPU_CORES" $PATH_TO_CHECK
|
||||||
|
|||||||
Reference in New Issue
Block a user