lukaqueres / Frequency

Discord bot with features including: planning, administration, and music playing.
http://theplanbot.com
GNU Affero General Public License v3.0
2 stars 0 forks source link

Database connection error #24

Closed lukaqueres closed 2 years ago

lukaqueres commented 2 years ago

There was error saying, that cursor has expired. Gues it could fix it:

`

try:

    cursor.execute(query)

except psycopg2.ProgrammingError as exc:

    print exc.message

    conn.rollback()

except psycopg2.InterfaceError as exc:

    print exc.message

    conn = psycopg2.connect(....)

    cursor = conn.cursor()

` Just do it