1

I wonder whether there could be difference between the following code snippets

from some_module.sub_module import some_function
@app.task(soft_time_limit=16, time_limit=18)
def call_function():
    some_function()

and

@app.task(soft_time_limit=16, time_limit=18)
def call_function():
    from some_module.sub_module import some_function
    some_function()

I'm using celery with Django and there are around 16 celery processes. Is there some difference between th abovementioned pieces of the code? I feel like there can be some difference. What if inside some_module.sub_module module there is a variable? Will all workers share it? Or absolutely everything is separated?

Thank you.

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.