mirror of
https://github.com/clearml/clearml-server
synced 2025-03-03 10:43:10 +00:00
Add default workers timeout to the server's configuration
This commit is contained in:
parent
6664c6237e
commit
cfbb37238f
@ -24,9 +24,7 @@ class WorkerRequest(Base):
|
||||
|
||||
|
||||
class RegisterRequest(WorkerRequest):
|
||||
timeout = make_default(
|
||||
IntField, DEFAULT_TIMEOUT
|
||||
)() # registration timeout in seconds (default is 10min)
|
||||
timeout = IntField(default=0) # registration timeout in seconds (if not specified, default is 10min)
|
||||
queues = ListField(six.string_types) # list of queues this worker listens to
|
||||
|
||||
|
||||
|
@ -113,6 +113,10 @@
|
||||
# Timeout in seconds on task status update. If exceeded
|
||||
# then task can be stopped without communicating to the worker
|
||||
task_update_timeout: 600
|
||||
|
||||
# Timeout in seconds for worker registration (or status report). If a worker did not report for this long,
|
||||
# it is discarded from the server's table
|
||||
default_timeout: 600
|
||||
}
|
||||
|
||||
check_for_updates {
|
||||
|
@ -56,6 +56,9 @@ def register(call: APICall, company_id, request: RegisterRequest):
|
||||
timeout = request.timeout
|
||||
queues = request.queues
|
||||
|
||||
if not timeout:
|
||||
timeout = config.get("apiserver.workers.default_timeout", 10 * 60)
|
||||
|
||||
if not timeout or timeout <= 0:
|
||||
raise bad_request.WorkerRegistrationFailed(
|
||||
"invalid timeout", timeout=timeout, worker=worker
|
||||
|
Loading…
Reference in New Issue
Block a user