mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-24 06:05:56 -05:00
Only use transactions on reload to avoid busy errors
This commit is contained in:
parent
2967af19ea
commit
b20dece00b
@ -364,13 +364,13 @@ int db_sqlite2_event(int event_type) {
|
||||
break;
|
||||
|
||||
case DB_SQL_EVENT_PLSCANSTART:
|
||||
db_sqlite2_exec(NULL,E_FATAL,"begin transaction");
|
||||
if(db_sqlite2_reload)
|
||||
db_sqlite2_exec(NULL,E_FATAL,"begin transaction");
|
||||
break;
|
||||
|
||||
case DB_SQL_EVENT_PLSCANEND:
|
||||
db_sqlite2_exec(NULL,E_FATAL,"end transaction");
|
||||
|
||||
if(db_sqlite2_reload) {
|
||||
db_sqlite2_exec(NULL,E_FATAL,"end transaction");
|
||||
db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal");
|
||||
db_sqlite2_exec(NULL,E_FATAL,"create index idx_songid on playlistitems(songid)");
|
||||
db_sqlite2_exec(NULL,E_FATAL,"create index idx_playlistid on playlistitems(playlistid)");
|
||||
|
@ -383,13 +383,13 @@ int db_sqlite3_event(int event_type) {
|
||||
break;
|
||||
|
||||
case DB_SQL_EVENT_PLSCANSTART:
|
||||
db_sqlite3_exec(NULL,E_FATAL,"begin transaction");
|
||||
if(db_sqlite3_reload)
|
||||
db_sqlite3_exec(NULL,E_FATAL,"begin transaction");
|
||||
break;
|
||||
|
||||
case DB_SQL_EVENT_PLSCANEND:
|
||||
db_sqlite3_exec(NULL,E_FATAL,"end transaction");
|
||||
|
||||
if(db_sqlite3_reload) {
|
||||
db_sqlite3_exec(NULL,E_FATAL,"end transaction");
|
||||
db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous=normal");
|
||||
db_sqlite3_exec(NULL,E_FATAL,"create index idx_songid on playlistitems(songid)");
|
||||
db_sqlite3_exec(NULL,E_FATAL,"create index idx_playlistid on playlistitems(playlistid)");
|
||||
|
Loading…
Reference in New Issue
Block a user