ActivityWatch / ActivityWatch/aw-server

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

Offen
#100 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
128
Forks
94
Ø Merge
4 T. 18 Std.
Gemergte PRs (30 T.)
3

Beschreibung

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

```py
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
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.