EOX GitLab Instance

Commit 8eb4b400 authored by Fabian Schindler's avatar Fabian Schindler
Browse files

Fixing LICENSE

Adding timeout option for queue CLI
parent 11881a4f
MIT License
Copyright (c) 2021, Fabian Schindler
Copyright (C) 2021 EOX IT Services GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -10,7 +10,9 @@ with open('README.rst') as readme_file:
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['Click>=7.0', ]
requirements = [
'Click>=7.0',
]
setup_requirements = ['pytest-runner', ]
......@@ -33,7 +35,8 @@ setup(
description="",
entry_points={
'console_scripts': [
'vsq-sync=vsq.queue:cli',
'vsq=vsq.queue:cli',
'vsq-async=vsq.queue:cli',
],
},
install_requires=requirements,
......
......@@ -300,8 +300,9 @@ def daemon(ctx, name, handler):
@click.argument('value', type=str)
@click.option('-j', '--json', 'as_json', is_flag=True, type=bool)
@click.option('-w', '--wait', is_flag=True, type=bool)
@click.option('-t', '--timeout', type=int, default=None)
@click.pass_context
def message(ctx, name, value, as_json=False, wait=False):
def message(ctx, name, value, as_json=False, wait=False, timeout=None):
"""Send a message to the specified queue"""
message = value
......@@ -313,7 +314,7 @@ def message(ctx, name, value, as_json=False, wait=False):
if wait:
try:
result = task.get()
result = task.get(timeout)
print(result)
return 0
except TaskFailedException as e:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment