fsu-fall2022-capstone / Project-Group-5

A discord bot that connects to the online game nationstates
1 stars 0 forks source link

SQL Table bug #28

Closed CoderJoshDK closed 1 year ago

CoderJoshDK commented 1 year ago

Bug on get_batch_of_all function from the base class

The issue is that the connection is used to generate a cursor. With that type of use, it messes up other aspects of the connection.

In context, table_row_count = await self.get_row_count(con=con) would return None because the connection is moved.

The fix

Don't pass in the connection into the get_row_count. It is wrapped under an ensure_connection function. Meaning it will generate a new connection that will give the correct output.