Fix repack when using pymysql (#37142)

pull/37280/head
J. Nick Koston 2020-06-26 11:45:40 -05:00 committed by Paulus Schoutsen
parent 976cbdd2aa
commit 56853787e7
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ def purge_old_data(instance, purge_days: int, repack: bool) -> bool:
_LOGGER.debug("Vacuuming SQL DB to free space")
instance.engine.execute("VACUUM")
# Optimize mysql / mariadb tables to free up space on disk
elif instance.engine.driver == "mysqldb":
elif instance.engine.driver in ("mysqldb", "pymysql"):
_LOGGER.debug("Optimizing SQL DB to free space")
instance.engine.execute("OPTIMIZE TABLE states, events, recorder_runs")