Skip to content

Commit 341a472

Browse files
authored
Merge pull request #144 from web-genie-ai/hotfix/thread-issue
hotfix: resolve thread issue
2 parents b4ab623 + 6ee1748 commit 341a472

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

neurons/validators/genie_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
class GenieValidator:
5151
def __init__(self, neuron: BaseNeuron):
5252
self.neuron = neuron
53-
self.lock = threading.Lock()
53+
self.lock = self.neuron.lock
5454
self.config = neuron.config
5555
self.miner_results = []
5656
self.synthetic_tasks = []

neurons/validators/score_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ScoreManager:
2222
def __init__(self, neuron: BaseNeuron):
2323
self.neuron = neuron
2424
self.state_path = self.neuron.config.neuron.full_path + "/state.npz"
25-
self.lock = threading.Lock()
25+
self.lock = self.neuron.lock
2626

2727
self.hotkeys = copy.deepcopy(self.neuron.metagraph.hotkeys)
2828
self.current_session = -1

neurons/validators/validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __init__(self, config=None):
6969
self.query_miners_thread: Union[threading.Thread, None] = None
7070
self.score_thread: Union[threading.Thread, None] = None
7171
self.sync_thread: Union[threading.Thread, None] = None
72-
self.lock = threading.Lock()
72+
self.lock = threading.RLock()
7373

7474
self.genie_validator = GenieValidator(neuron=self)
7575
self.score_manager = ScoreManager(neuron=self)

0 commit comments

Comments
 (0)