Avoid cache regeneration triggering during db_query_run (in case the query is long running, like db_files_update_songalbumid might be)

This commit is contained in:
ejurgensen
2015-06-08 23:07:56 +02:00
parent 335517a2e8
commit 879c2ef350
3 changed files with 84 additions and 0 deletions

View File

@@ -1589,6 +1589,9 @@ db_query_run(char *query, int free, int cache_update)
DPRINTF(E_DBG, L_DB, "Running query '%s'\n", query);
/* If the query will be long running we don't want the cache to start regenerating */
cache_daap_suspend();
ret = db_exec(query, &errmsg);
if (ret != SQLITE_OK)
DPRINTF(E_LOG, L_DB, "Error '%s' while runnning '%s'\n", errmsg, query);
@@ -1600,6 +1603,8 @@ db_query_run(char *query, int free, int cache_update)
if (cache_update)
cache_daap_trigger();
else
cache_daap_resume();
return ((ret != SQLITE_OK) ? -1 : 0);
}