Skip to content

Commit

Permalink
feat: allow set max runners for nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Dec 11, 2024
1 parent 1fe74fa commit 272371d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/docker-crawlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,6 @@ jobs:
env:
CRAWLAB_NODE_MASTER: N
CRAWLAB_MASTER_HOST: master
options: >-
--health-cmd "curl -f http://localhost:8000/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions core/task/handler/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func (svc *Service) fetchAndRunTasks() {
continue
}

// validate if there are available runners
if svc.getRunnerCount() >= n.MaxRunners {
// validate if max runners is reached (max runners = 0 means no limit)
if n.MaxRunners > 0 && svc.getRunnerCount() >= n.MaxRunners {
continue
}

Expand Down
2 changes: 1 addition & 1 deletion core/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
DefaultApiAllowCredentials = "true"
DefaultApiAllowMethods = "DELETE, POST, OPTIONS, GET, PUT"
DefaultApiAllowHeaders = "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, accept, origin, Cache-Control, X-Requested-With"
DefaultNodeMaxRunners = 16
DefaultNodeMaxRunners = 0 // 0 means no limit
MetadataConfigDirName = ".crawlab"
MetadataConfigName = "config.json"
PyenvRoot = "/root/.pyenv"
Expand Down

0 comments on commit 272371d

Please sign in to comment.