0

現在、postgres データベースを再起動するとクラッシュするフラスコ アプリケーションを作成しました。これは、開かれたカーソルが古くなっているためです ...

この状況をどのように処理しますか。現在、フラスコアプリをpsycopg2経由でpostgresに接続しています....

私はデータベースの専門家ではありません...

  Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1701, in __call__
    return self.wsgi_app(environ, start_response)
  File "/var/www/flaskapps/capp/override.py", line 15, in __call__
    return self.app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1689, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1356, in full_dispatch_request
    rv = self.preprocess_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1539, in preprocess_request
    rv = func()
  File "/usr/local/lib/python2.7/dist-packages/flask_login.py", line 321, in _load_user
    self.reload_user()
  File "/usr/local/lib/python2.7/dist-packages/flask_login.py", line 350, in reload_user
    user = self.user_callback(user_id)
  File "/var/www/flaskapps/capp/login_setup.py", line 163, in load_user
    cursor.execute(qstr)
  File "/usr/share/pyshared/psycopg2/extras.py", line 123, in execute
    return _cursor.execute(self, query, vars)
InterfaceError: cursor already closed
4

1 に答える 1