ActivityWatch / ActivityWatch/aw-server

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

Đang mở
#100 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
128
Fork
94
Merge trung bình
4 ngày 18 giờ
Pull request đã merge (30 ngày)
3

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.