mikeshardmind / discord-scheduler

Mozilla Public License 2.0
9 stars 1 forks source link

"cannot change into wal mode from within a transaction" #2

Closed LeoCx1000 closed 1 year ago

LeoCx1000 commented 1 year ago

Initialising the scheduler fails with the following error

Traceback (most recent call last):
<...>
  File "...\site-packages\scheduler\scheduler.py", line 367, in __aenter__
    self._zones = await asyncio.to_thread(_setup_db, self._connection)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<...>
  File "...\site-packages\scheduler\scheduler.py", line 232, in _setup_db
    cursor.execute(INITIALIZATION_STATEMENTS)
  File "D:\a\apsw\apsw\src\cursor.c", line 240, in resetcursor
apsw.SQLError: SQLError: cannot change into wal mode from within a transaction
mikeshardmind commented 1 year ago

@LeoCx1000 Thanks for the report (And the other recent one too), I hadn't pulled the latest version for my own bot before I ended up shutting it down and missed an issue with simplifying some code. I've gone ahead with a release after fixing that, as well as improving the overall type coverage and performance. I'll be adding tests for both of these issues, and a few others including an integration test later on to prevent similar future issues.

LeoCx1000 commented 1 year ago

You rock! ❤️