When running django celery tasks, i see that my task re execute after every hour, maybe by default visibility_timeout setting, so i try to change visibility_timeout = 120 for re execute task every 120 seconds in celery.py config like this.
app.config_from_object('django.conf:settings')
installed_apps = [app_config.name for app_config in apps.get_app_configs()]
app.conf.broker_transport_options = {'visibility_timeout': 120}
app.autodiscover_tasks(lambda: installed_apps, force=True)
But it doesn't work, what is the correct way to change visibility_timeout? I run my task from script running_celery_task.py with command: python manage.py shell < running_celery_task.py.
Here is running_celery_task.py
from project.app.tasks import my_task
my_task.delay()