Skip to content

Commit

Permalink
queue ends with localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Oct 28, 2016
1 parent 7dc8c8e commit a67e6e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Released on XXX
- Removed local argument from Task.send_to_queue method.
Pass host="localhost" for sending to local queue.
- Removed local argument from worker command.
If queue name ends with "." hostname will be appended to queue name.
If queue name ends with ".localhost" hostname will be appended to queue name.
- Removed deprecated Worker.queue property.

Version 5.1.0
Expand Down
3 changes: 2 additions & 1 deletion kuyruk/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def main():
default=[],
action='append',
help='consume tasks from queue (may be specified multiple times), '
'if queue name ends with "." hostname will be appended to queue name')
'if queue name ends with ".localhost" hostname will be appended '
'to queue name')
parser_worker.add_argument(
'--max-load',
type=float,
Expand Down
3 changes: 2 additions & 1 deletion kuyruk/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def __init__(self, app, args):
args.queues = ['kuyruk']

def add_host(queue):
if queue.endswith('.'):
if queue.endswith('.localhost'):
queue = queue.rsplit('.localhost')[0]
return "%s.%s" % (queue, self._hostname)
else:
return queue
Expand Down

0 comments on commit a67e6e5

Please sign in to comment.