Ticket #2194: housekeeper.diff
File housekeeper.diff, 1.4 KB (added by , 19 years ago) |
---|
-
programs/mythbackend/housekeeper.cpp
50 50 unsigned int longEnough = 0; 51 51 52 52 if (period) 53 longEnough = ((period * oneday) - 600);53 longEnough = ((period * oneday) - oneday/2); 54 54 else 55 55 longEnough = oneday / 8; 56 56 … … 69 69 result.next(); 70 70 lastrun = result.value(0).toDateTime(); 71 71 72 if ((now.toTime_t() - lastrun.toTime_t()) > longEnough) 72 if ((now.toTime_t() - lastrun.toTime_t()) > longEnough && 73 (now.toString(QString("d")).toInt() != lastrun.toString(QString("d")).toInt())) 73 74 { 74 75 int hour = now.toString(QString("h")).toInt(); 75 76 if ((hour >= minhour) && (hour <= maxhour)) 76 runOK = true; 77 { 78 int minute = now.toString(QString("m")).toInt(); 79 if ((hour == maxhour && minute > 30) 80 || ((random()%((maxhour-hour)*12+(60-minute)/5 - 6) == 0))) 81 runOK = true; 82 } 77 83 } 78 84 } 79 85 else … … 239 245 updateLastrun(dbTag); 240 246 } 241 247 242 sleep(300 );248 sleep(300 + (random()%8)); 243 249 } 244 250 } 245 251