I have an instance of Celery running with Redis server in an archlinux machine. In this instance I have defined some tasks to be executed every X minutes. The schedule is working correctly (if I check the logs, the tasks are being called), but there is a task outputting an error. The task is to run another python script. If I run this script manually, it works perfectly. But when celery try to execute it, I receive this error:
WARNING/ForkPoolWorker-93] Exception in thread Thread-6:
Traceback (most recent call last):
File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
TypeError: 'int' object is not callable
The tasks.py is:
@periodic_task(
run_every=(crontab(minute='*/15')),
name="sm37_auto",
ignore_result=True
)
def sm37_auto():
comando_sm37 = os.system("python /home/user/sm37.py")
background_thread=threading.Thread(target=comando_sm37)
background_thread.start()
return 'ejecuta SM37 ok'
Could somebody help me?