Changed gui parameter to take a numeric value which is the

number of hours to write data to disk
This commit is contained in:
andyb2000 2013-03-07 21:35:15 +00:00
parent 3752158b92
commit 4b7ffc058f
4 changed files with 18 additions and 11 deletions

View file

@ -61,11 +61,12 @@
<dt>Update channel name
<dd>Automatically update channel icons using information provided
by the enabled EPG providers.
<dt>Periodic save EPG to disk
<dd>Writes the current in-memory EPG database to disk every 8 Hours
when checked, so should a crash/unexpected shutdown occur EPG
<dt>Periodic save EPG to disk Interval
<dd>Writes the current in-memory EPG database to disk every x Hours
(user defined), so should a crash/unexpected shutdown occur EPG
data is saved periodically to the database (Re-read on
next startup)
Set to 0 to disable.
</dl>
<h3>Internal Grabber</h3>

View file

@ -148,14 +148,14 @@ static void *_epgdbsave_thread ( void *p )
ts.tv_nsec = 0;
tvhlog(LOG_DEBUG, "epgdb", "epgdbsave setting: %i", epggrab_epgdb_periodicsave);
while (1) {
if (epggrab_epgdb_periodicsave) {
if (epggrab_epgdb_periodicsave != 0) {
tvhlog(LOG_DEBUG, "epgdb", "epgdbsave setting: %i",
epggrab_epgdb_periodicsave);
epg_save();
};
pthread_mutex_lock(&epgdbsave_mutex);
time(&ts.tv_sec);
ts.tv_sec += 28800; /* Every 8 hours */
ts.tv_sec += epggrab_epgdb_periodicsave * 3600; /* User defined in hours */
pthread_cond_timedwait(&_epgdbsave_cond, &epgdbsave_mutex, &ts);
pthread_mutex_unlock(&epgdbsave_mutex);
};

View file

@ -620,8 +620,8 @@ extjs_epggrab(http_connection_t *hc, const char *remain, void *opaque)
save |= epggrab_set_channel_renumber(str ? 1 : 0);
str = http_arg_get(&hc->hc_req_args, "channel_reicon");
save |= epggrab_set_channel_reicon(str ? 1 : 0);
str = http_arg_get(&hc->hc_req_args, "epgdb_periodicsave");
save |= epggrab_set_periodicsave(str ? 1 : 0);
if ( (str = http_arg_get(&hc->hc_req_args, "epgdb_periodicsave")) )
save |= epggrab_set_periodicsave(atoi(str));
if ( (str = http_arg_get(&hc->hc_req_args, "interval")) )
save |= epggrab_set_interval(atoi(str));
if ( (str = http_arg_get(&hc->hc_req_args, "module")) )

View file

@ -184,10 +184,16 @@ tvheadend.epggrab = function() {
fieldLabel : 'Update channel icon'
});
var epgPeriodicSave = new Ext.form.Checkbox({
name : 'epgdb_periodicsave',
fieldLabel : 'Periodic save EPG to disk'
});
var epgPeriodicSave = new Ext.form.NumberField({
width : 30,
allowNegative : false,
allowDecimals : false,
minValue : 0,
maxValue : 24,
value : 0,
fieldLabel : 'Periodic save EPG to disk',
name : 'epgdb_periodicsave',
});
/*
* Simple fields