Skip to content

Few question from beginners. #118

@kobzar

Description

@kobzar

Hello.
First, thanks for the great work.
But I can found answers for my question in doc.
So, may be some one can help me.

  1. If I use RedisPool for my own data access in startup parameter like
async def startup(ctx):
    qredis = await arq_create_pool(settings=RedisSettings(host='localhost', port=6379, database=1))
    ctx['redis_cache'] = redis_cache

And use it in my function later

class WorkerSettings:
    functions = [get_messages]
    on_startup = startup
    on_shutdown = shutdown

async def get_messages(ctx):
    redis_cache = ctx['redis_cache']
    print(f"LAST_MAIL_ID: {await redis_cache.get('last_id')}")

Does I am need close this poll in on_shutdown params?

  1. How I can run workers from python file? Not from system terminal like
    # arq my_file.WorkeRname

  2. How I can work with output log? Disable it or retranslate it in to file?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions