We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppose I add a job to a queue and later I add another job with the same job_id then even before the completion of job it returns JobStatus.complete.
JobStatus.complete
example:
import asyncio from aiohttp import ClientSession from arq import create_pool from arq.connections import RedisSettings async def download_content(ctx, url): session: ClientSession = ctx['session'] async with session.get(url) as response: content = await response.text() print(f'{url}: {content:.80}...') return len(content) async def startup(ctx): ctx['session'] = ClientSession() async def shutdown(ctx): await ctx['session'].close() async def main(): redis = await create_pool(RedisSettings()) job_list = [] for url in ('https://facebook.com', 'https://microsoft.com', 'https://github.com'): job = await redis.enqueue_job('download_content', url, _job_id=url) job_list.append(job) for j_ in job_list: print( j_.job_id) print(await j_.status()) # WorkerSettings defines the settings to use when creating the work, # it's used by the arq cli class WorkerSettings: functions = [download_content] on_startup = startup on_shutdown = shutdown if __name__ == '__main__': loop = asyncio.get_event_loop() loop.run_until_complete(main())
Running this twice:
(sanic) ╭─adam@adams-MacBook-Air ~/sidekik ╰─$ python arqq_.py https://facebook.com JobStatus.queued https://microsoft.com JobStatus.queued https://github.com JobStatus.queued (sanic) ╭─adam@adams-MacBook-Air ~/sidekik ╰─$ python arqq_.py https://facebook.com JobStatus.complete https://microsoft.com JobStatus.complete https://github.com JobStatus.complete
The text was updated successfully, but these errors were encountered:
Thanks for reporting, should be fixed in #138. Please can you check that solves your problem.
Sorry, something went wrong.
Thank you for the quick fix.
Successfully merging a pull request may close this issue.
Suppose I add a job to a queue and later I add another job with the same job_id then even before the completion of job it returns
JobStatus.complete
.example:
Running this twice:
The text was updated successfully, but these errors were encountered: