mirror of
https://projects.vdr-developer.org/git/vdr-plugin-scraper2vdr.git
synced 2023-10-19 17:58:31 +02:00
added sleep during loading series initially to reduce system load
This commit is contained in:
parent
ea862b36b2
commit
7231362092
6
update.c
6
update.c
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
extern cScraper2VdrConfig config;
|
extern cScraper2VdrConfig config;
|
||||||
|
|
||||||
cUpdate::cUpdate(cScrapManager *manager) : cThread("update thread started") {
|
cUpdate::cUpdate(cScrapManager *manager) : cThread("update thread started", true) {
|
||||||
connection = NULL;
|
connection = NULL;
|
||||||
vdrDb = NULL;
|
vdrDb = NULL;
|
||||||
tEvents = NULL;
|
tEvents = NULL;
|
||||||
@ -476,6 +476,7 @@ int cUpdate::ReadSeries(bool isRec) {
|
|||||||
|
|
||||||
bool isNew = false;
|
bool isNew = false;
|
||||||
int numNew = 0;
|
int numNew = 0;
|
||||||
|
int i=0;
|
||||||
while (scrapManager->GetNextSeries(isRec, seriesId, episodeId) && Running()) {
|
while (scrapManager->GetNextSeries(isRec, seriesId, episodeId) && Running()) {
|
||||||
cTVDBSeries *series = scrapManager->GetSeries(seriesId);
|
cTVDBSeries *series = scrapManager->GetSeries(seriesId);
|
||||||
if (!series) {
|
if (!series) {
|
||||||
@ -501,6 +502,9 @@ int cUpdate::ReadSeries(bool isRec) {
|
|||||||
LoadSeriesMedia(series, seriesPath);
|
LoadSeriesMedia(series, seriesPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
waitCondition.TimedWait(mutex, 3);
|
||||||
|
if (++i % 500 == 0)
|
||||||
|
tell(0, "Loaded %d series, continuing...", i);
|
||||||
numNew++;
|
numNew++;
|
||||||
}
|
}
|
||||||
return numNew;
|
return numNew;
|
||||||
|
Loading…
Reference in New Issue
Block a user