Skip to content

Commit

Permalink
Reviewed option max_workers parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Delle Cave committed Jan 12, 2020
1 parent ada4d1f commit 8f60e02
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
python-dwho (0.3.24) unstable; urgency=medium

* Reviewed option max_workers parsing.

-- Adrien DELLE CAVE (Decryptus) <adc@doowan.net> Sun, 12 Jan 2020 17:49:10 +0100

python-dwho (0.3.23) unstable; urgency=medium

* Reviewed requirements.
Expand Down
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.23
0.3.24
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.23
0.3.24
7 changes: 5 additions & 2 deletions dwho/classes/inotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,12 @@ def __init__(self):

def init(self, config):
self.config = config
self.workerpool = WorkerPool(max_workers = int(config['inotify'].get('max_workers') or MAX_WORKERS),
self.workerpool = WorkerPool(max_workers = helpers.get_nb_workers(config['inotify'].get('max_workers'),
xmin = 1,
default = MAX_WORKERS),
life_time = config['inotify'].get('worker_lifetime'),
name = 'inoworker')
name = 'inoworker',
max_tasks = config['inotify'].get('max_tasks'))

return self

Expand Down
7 changes: 4 additions & 3 deletions dwho/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_softname():
def set_softver(version):
global _SOFTVER

if not _SOFTVER and has_len.has_len(version):
if not _SOFTVER and helpers.has_len(version):
_SOFTVER = version

def get_softver():
Expand Down Expand Up @@ -94,8 +94,9 @@ def parse_conf(conf, load_creds = False):
if not conf['general'].get('max_body_size'):
conf['general']['max_body_size'] = MAX_BODY_SIZE

if not conf['general'].get('max_workers'):
conf['general']['max_workers'] = MAX_WORKERS
conf['general']['max_workers'] = helpers.get_nb_workers(conf['general'].get('max_workers'),
xmin = 1,
default = MAX_WORKERS)

if not conf['general'].get('max_requests'):
conf['general']['max_requests'] = MAX_REQUESTS
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
escapejson
httpdis>=0.6.9
httpdis>=0.6.10
Mako
PyYAML>=3.10
pyinotify
python-dotenv
redis>=2.4.0
requests>=2.0
six>=1.13.0
sonicprobe>=0.3.22
sonicprobe>=0.3.23
4 changes: 2 additions & 2 deletions setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: dwho
author: Adrien Delle Cave
author_email: pypi@doowan.net
copyright: '2020 Adrien Delle Cave'
release: '0.3.23'
version: '0.3.23'
release: '0.3.24'
version: '0.3.24'
license: License GPL-3
url: https://github.com/decryptus/dwho
python_requires:
Expand Down

0 comments on commit 8f60e02

Please sign in to comment.