-
-
Notifications
You must be signed in to change notification settings - Fork 211
Few question from beginners. #118
Copy link
Copy link
Closed
Labels
Description
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.
- 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?
-
How I can run workers from python file? Not from system terminal like
# arq my_file.WorkeRname -
How I can work with output log? Disable it or retranslate it in to file?
Thanks
Reactions are currently unavailable