Skip to content

Commit

Permalink
excavator: Remove the rate limiter, it doesn't seem necessary after a…
Browse files Browse the repository at this point in the history
…ll - failing tests may be due to excavator bug.
  • Loading branch information
YoRyan committed Dec 9, 2018
1 parent 73a3199 commit 44d15d6
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions nuxhash/miners/excavator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import socket
import subprocess
import threading
import time

from nuxhash.devices.nvidia import NvidiaDevice
from nuxhash.miners import miner
Expand Down Expand Up @@ -50,15 +49,13 @@ class ExcavatorServer(object):

BUFFER_SIZE = 1024
TIMEOUT = 10
RATE_LIMIT = 0.1

def __init__(self, executable):
self._executable = executable
self.__subscription = self._process = None
self._randport = get_port()
self.__address = ('127.0.0.1', self._randport)
self._extra_args = []
self._limiter = RateLimiter(min_interval=self.RATE_LIMIT)
# dict of algorithm name -> ESAlgorithm
self._running_algorithms = {algorithm: ESAlgorithm(self, algorithm)
for algorithm in ALGORITHMS}
Expand Down Expand Up @@ -159,7 +156,6 @@ def send_command(self, method, params):
method -- name of the command to execute
params -- list of arguments for the command
"""
self._limiter.wait()
# Send newline-terminated command.
command = {
'id': 1,
Expand Down Expand Up @@ -191,7 +187,6 @@ def send_command_only(self, method, params):
method -- name of the command to execute
params -- list of arguments for the command
"""
self._limiter.wait()
# Send newline-terminated command.
command = {
'id': 1,
Expand Down Expand Up @@ -255,20 +250,6 @@ def device_speeds(self, device):
for algorithm in data['algorithms']}


class RateLimiter(object):

def __init__(self, min_interval=1):
self._min_interval = min_interval
self._last = None

def wait(self):
if self._last is not None:
t = time.time() - self._last
if t < self._min_interval:
time.sleep(self._min_interval - t)
self._last = time.time()


class ESResource(object):

def __init__(self):
Expand Down

0 comments on commit 44d15d6

Please sign in to comment.