Skip to content

Commit d084e58

Browse files
committed
as attribute
1 parent d27022f commit d084e58

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

distributed/scheduler.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
Set,
3232
)
3333
from contextlib import suppress
34-
from functools import cached_property, partial
34+
from functools import partial
3535
from typing import TYPE_CHECKING, Any, ClassVar, Literal, NamedTuple, cast, overload
3636

3737
import psutil
@@ -513,6 +513,8 @@ class WorkerState:
513513
#: on the worker.
514514
needs_what: dict[TaskState, int]
515515

516+
host: str
517+
516518
__slots__ = tuple(__annotations__)
517519

518520
def __init__(
@@ -564,6 +566,7 @@ def __init__(
564566
self.needs_what = {}
565567
self._network_occ = 0
566568
self._occupancy_cache = None
569+
self.host = get_address_host(self.address)
567570

568571
def __hash__(self) -> int:
569572
return self._hash
@@ -584,10 +587,6 @@ def has_what(self) -> Set[TaskState]:
584587
"""
585588
return self._has_what.keys()
586589

587-
@cached_property
588-
def host(self) -> str:
589-
return get_address_host(self.address)
590-
591590
@property
592591
def memory(self) -> MemoryState:
593592
"""Polished memory metrics for the worker.

0 commit comments

Comments
 (0)