nknaian / musicrecs

A Spotify-powered music recommendation platform with snoozin 'n friends
MIT License
3 stars 0 forks source link

Rapid refreshes breaks sql on localhost #35

Open nknaian opened 3 years ago

nknaian commented 3 years ago

When spamming the refresh button on a round in a localhost test session, eventually this error message comes up: " sqlalchemy.exc.InvalidRequestError

sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (sqlite3.OperationalError) database is locked [SQL: UPDATE submission SET shuffled_pos=? WHERE submission.id = ?] [parameters: ((3, 15), (1, 16), (0, 17), (2, 18))] (Background on this error at: http://sqlalche.me/e/13/e3q8) (Background on this error at: http://sqlalche.me/e/13/7s2a) "

...is this something that can happen on the actual server too? Maybe there's a safeguard we need to put in to protect against spamming?