Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions proxy/core/acceptor/acceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ def run_once(self) -> None:
if locked:
self.lock.release()
for work in works:
if self.flags.local_executor == int(DEFAULT_LOCAL_EXECUTOR):
if self.flags.threadless and \
self.flags.local_executor:
assert self._local_work_queue
self._local_work_queue.put(work)
else:
Expand All @@ -171,7 +172,7 @@ def run(self) -> None:
type=socket.SOCK_STREAM,
)
try:
if self.flags.local_executor == int(DEFAULT_LOCAL_EXECUTOR):
if self.flags.threadless and self.flags.local_executor:
self._start_local()
self.selector.register(self.sock, selectors.EVENT_READ)
while not self.running.is_set():
Expand All @@ -180,7 +181,7 @@ def run(self) -> None:
pass
finally:
self.selector.unregister(self.sock)
if self.flags.local_executor == int(DEFAULT_LOCAL_EXECUTOR):
if self.flags.threadless and self.flags.local_executor:
self._stop_local()
self.sock.close()
logger.debug('Acceptor#%d shutdown', self.idd)
Expand Down
2 changes: 1 addition & 1 deletion proxy/core/work/threadless.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def run(self) -> None:
data=wqfileno,
)
assert self.loop
# logger.debug('Working on {0} works'.format(len(self.works)))
logger.debug('Working on {0} works'.format(len(self.works)))
self.loop.create_task(self._run_forever())
self.loop.run_forever()
except KeyboardInterrupt:
Expand Down
4 changes: 2 additions & 2 deletions proxy/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from .common.utils import bytes_
from .common.flag import FlagParser, flags
from .common.constants import DEFAULT_ENABLE_SSH_TUNNEL, DEFAULT_LOCAL_EXECUTOR, DEFAULT_LOG_FILE
from .common.constants import DEFAULT_ENABLE_SSH_TUNNEL, DEFAULT_LOG_FILE
from .common.constants import DEFAULT_OPEN_FILE_LIMIT, DEFAULT_PLUGINS, DEFAULT_VERSION
from .common.constants import DEFAULT_ENABLE_DASHBOARD, DEFAULT_WORK_KLASS, DEFAULT_PID_FILE
from .common.constants import DEFAULT_LOG_FORMAT, DEFAULT_LOG_LEVEL, IS_WINDOWS
Expand Down Expand Up @@ -242,7 +242,7 @@ def shutdown(self) -> None:
@property
def remote_executors_enabled(self) -> bool:
return self.flags.threadless and \
not (self.flags.local_executor == int(DEFAULT_LOCAL_EXECUTOR))
not self.flags.local_executor

def _write_pid_file(self) -> None:
if self.flags.pid_file:
Expand Down