You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking to queue some of the Python @staticmethods. For some reason, I am getting following error when using Python RQ/ Flask-RQ2. Please help.
@staticmethod
@rq.job
def add_request(request):
db.session.add(request)
db.session.commit()
@staticmethod
@rq.job
def monitor_request(id):
job = Job.fetch(id)
accepted_statues = ['finished','failed']
while job.status not in accepted_statues:
time.sleep(1)
request = Requests.query.filter_by(jobid=job.id).first()
request.status = job.status
db.session.add(request)
db.session.commit()
15:30:06 AttributeError: 'module' object has no attribute 'add_request'
Traceback (most recent call last):
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/worker.py", line 789, in perform_job
rv = job.perform()
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 573, in perform
self._result = self._execute()
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 579, in _execute
return self.func(*self.args, **self.kwargs)
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 206, in func
return import_attribute(self.func_name)
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/utils.py", line 153, in import_attribute
return getattr(module, attribute)
AttributeError: 'module' object has no attribute 'add_request'
Traceback (most recent call last):
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/worker.py", line 789, in perform_job
rv = job.perform()
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 573, in perform
self._result = self._execute()
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 579, in _execute
return self.func(*self.args, **self.kwargs)
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 206, in func
return import_attribute(self.func_name)
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/utils.py", line 153, in import_attribute
return getattr(module, attribute)
AttributeError: 'module' object has no attribute 'add_request'
15:30:06 Moving job to u'failed' queue
The text was updated successfully, but these errors were encountered:
Hello,
I am looking to queue some of the Python @staticmethods. For some reason, I am getting following error when using Python RQ/ Flask-RQ2. Please help.
15:30:06 AttributeError: 'module' object has no attribute 'add_request'
Traceback (most recent call last):
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/worker.py", line 789, in perform_job
rv = job.perform()
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 573, in perform
self._result = self._execute()
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 579, in _execute
return self.func(*self.args, **self.kwargs)
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 206, in func
return import_attribute(self.func_name)
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/utils.py", line 153, in import_attribute
return getattr(module, attribute)
AttributeError: 'module' object has no attribute 'add_request'
Traceback (most recent call last):
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/worker.py", line 789, in perform_job
rv = job.perform()
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 573, in perform
self._result = self._execute()
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 579, in _execute
return self.func(*self.args, **self.kwargs)
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/job.py", line 206, in func
return import_attribute(self.func_name)
File "/home/PROD.CAN/rsojshah/netaut/lib/python2.7/site-packages/rq/utils.py", line 153, in import_attribute
return getattr(module, attribute)
AttributeError: 'module' object has no attribute 'add_request'
15:30:06 Moving job to u'failed' queue
The text was updated successfully, but these errors were encountered: