I'm getting the following error after my scheduled task completes:
Traceback (most recent call last): File "/home/wdis/web2py/gluon/shell.py", line 273, in
run exec(python_code, _env)
File "<string>", line 1, in <module>
File "/home/wdis/web2py/gluon/scheduler.py", line 717, in loop
self.wrapped_report_task(task, self.async(task))
File "/home/wdis/web2py/gluon/scheduler.py", line 874, in wrapped_report_task
db.rollback()
File "/home/wdis/web2py/gluon/packages/dal/pydal/base.py", line 956, in rollback
self._adapter.rollback()
File "/home/wdis/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1342, in rollback return self.connection.rollback()
OperationalError: (2006, 'MySQL server has gone away')
It appears that the db connection created by the scheduler (to update the task status) gets stale and MySQL is closing it. I've tried adding dummy reads to the database in my scheduled task code but it seems to have no bearing on the db connection used by the scheduler.
Any advice? I'm using PythonAnywhere so I can not change the timeout setting for MySQL.
-Andre