Skip to content

Commit

Permalink
Merge pull request #108 from ewsterrenburg/improve-windows-compatibility
Browse files Browse the repository at this point in the history
Improve windows compatibility
  • Loading branch information
chris104957 committed Apr 14, 2019
2 parents cff7718 + fe1f55f commit 11c8790
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions carrot/management/commands/carrot.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ def handle(self, **options) -> None:
for q in psutil.process_iter():
if 'python' in q.name():
if len(q.cmdline()) > 1 and 'manage.py' in q.cmdline()[1] and 'carrot' in q.cmdline()[2]:
if not q._pid == os.getpgid(0):
running_pids.append(q._pid)
if os.name == 'nt':
if not q._pid == os.getpid():
running_pids.append(q._pid)
else:
if not q._pid == os.getpgid(0):
running_pids.append(q._pid)

if running_pids:
self.stdout.write(
Expand Down
2 changes: 1 addition & 1 deletion carrot/management/commands/carrot_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def start(self, **kwargs: dict) -> None:
if kwargs:
self.options = kwargs

options: list = ['python3', 'manage.py', 'carrot', '--verbosity', str(kwargs.get('verbosity', 2)),
options: list = [sys.executable, sys.argv[0], 'carrot', '--verbosity', str(kwargs.get('verbosity', 2)),
'--logfile', self.options['logfile'], '--loglevel', self.options['loglevel']]

if not self.options['run_scheduler']:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-carrot"
version = "1.4.4a0"
version = "1.5.0"
description = "A RabbitMQ asynchronous task queue for Django."
authors = ["Christoper Davies <christopherdavies553@gmail.com>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 11c8790

Please sign in to comment.