Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting data from server too "quickly" results in sqlite3.OperationalError #100

Open
BelKed opened this issue Jan 26, 2023 · 0 comments

Comments

@BelKed
Copy link
Contributor

BelKed commented Jan 26, 2023

Related to ActivityWatch/aw-webui#392.
Seems like the database gets locked when requesting another request before the current one is finished.

2023-01-24 22:28:31 [ERROR]: Exception on /api/0/buckets/aw-watcher-window_BelKeds-MBP/events [GET]  (aw-server:1449)
Traceback (most recent call last):
  File "peewee.py", line 3237, in execute_sql
sqlite3.OperationalError: database is locked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "flask/app.py", line 1517, in full_dispatch_request
  File "flask/app.py", line 1503, in dispatch_request
  File "aw_server/rest.py", line 46, in decorator
  File "flask_restx/api.py", line 405, in wrapper
  File "flask/views.py", line 84, in view
  File "flask_restx/resource.py", line 46, in dispatch_request
  File "aw_server/rest.py", line 208, in get
  File "aw_server/api.py", line 43, in g
  File "aw_server/api.py", line 191, in get_events
  File "aw_datastore/datastore.py", line 101, in get
  File "aw_datastore/storages/peewee.py", line 304, in get_events
  File "peewee.py", line 1962, in inner
  File "peewee.py", line 2033, in execute
  File "peewee.py", line 2206, in _execute
  File "peewee.py", line 3250, in execute
  File "peewee.py", line 3244, in execute_sql
  File "peewee.py", line 3010, in __exit__
  File "peewee.py", line 192, in reraise
  File "peewee.py", line 3237, in execute_sql
peewee.OperationalError: database is locked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant