mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 07:05:57 -05:00
wrap playlist scans in transaction
This commit is contained in:
parent
6891f3a169
commit
5e6575a153
@ -374,16 +374,15 @@ int db_sqlite2_event(int event_type) {
|
||||
break;
|
||||
|
||||
case DB_SQL_EVENT_PLSCANSTART:
|
||||
if(db_sqlite2_reload) {
|
||||
db_sqlite2_exec(NULL,E_FATAL,"begin transaction");
|
||||
db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous = off");
|
||||
}
|
||||
break;
|
||||
|
||||
case DB_SQL_EVENT_PLSCANEND:
|
||||
if(db_sqlite2_reload) {
|
||||
db_sqlite2_exec(NULL,E_FATAL,"pragma synchronous=normal");
|
||||
db_sqlite2_exec(NULL,E_FATAL,"end transaction");
|
||||
|
||||
if(db_sqlite2_reload) {
|
||||
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,songid)");
|
||||
|
||||
|
@ -406,16 +406,15 @@ int db_sqlite3_event(int event_type) {
|
||||
break;
|
||||
|
||||
case DB_SQL_EVENT_PLSCANSTART:
|
||||
if(db_sqlite3_reload) {
|
||||
db_sqlite3_exec(NULL,E_FATAL,"begin transaction");
|
||||
db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous = off");
|
||||
}
|
||||
break;
|
||||
|
||||
case DB_SQL_EVENT_PLSCANEND:
|
||||
if(db_sqlite3_reload) {
|
||||
db_sqlite3_exec(NULL,E_FATAL,"pragma synchronous=normal");
|
||||
db_sqlite3_exec(NULL,E_FATAL,"end transaction");
|
||||
|
||||
if(db_sqlite3_reload) {
|
||||
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,songid)");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user