asternic / wuzapi

Simple RESTful API for WhatsApp in Golang (using the Whatsmeow multi device library)
MIT License
105 stars 58 forks source link

bug => database is locked #11

Closed ahmedRSA closed 1 year ago

ahmedRSA commented 1 year ago

this error keep coming [Client ERROR] Failed to get prekey for retry receipt: failed to query next prekey ID: database is locked (5) (SQLITE_BUSY)

what it means i am using sqlite

ahmedRSA commented 1 year ago

this error because we are opening only one connection to the db and all users access db with same connection to fix this we have to use different connection for each user.

mpldr commented 1 year ago

I'd advise against opening multiple SQLite connections. SQLite is – by itself – perfectly capable of coordinating multiple queries. This is usually caused by doing just that: opening multiple connections to one database.

ahmedRSA commented 1 year ago

I'd advise against opening multiple SQLite connections. SQLite is – by itself – perfectly capable of coordinating multiple queries. This is usually caused by doing just that: opening multiple connections to one database.

i dont understand go, if anyone can open a PR to fix this issue it will help alot

ahmedRSA commented 1 year ago

i can read go code but cant code in it

asternic commented 1 year ago

Should be fixed in commit f320232