[mythtv-commits] Ticket #2544: Move mythfilldatabase cleanup tasks to the housekeeper
MythTV
mythtv at cvs.mythtv.org
Sat Oct 7 14:04:42 UTC 2006
#2544: Move mythfilldatabase cleanup tasks to the housekeeper
----------------------------------------------+-----------------------------
Reporter: sphery <mtdean at thirdcontact.com> | Owner: ijr
Type: patch | Status: new
Priority: minor | Milestone: unknown
Component: mythtv | Version: 0.20
Severity: medium |
----------------------------------------------+-----------------------------
The attached patches move cleanup functionality from mythfilldatabase to
the housekeeper. Previously, we made the assumption that all users would
run mythfilldatabase. However, now that EIT data has become a valid
alternative for some, many users do not need to run mythfilldatabase.
Currently, they must run mythfilldatabase at least occasionally to clean
expired recording rules, the oldrecorded table, and program listings.
After these patches, running mythfilldatabase will no longer be necessary
for EIT-only users and database cleanup will be performed on a daily
basis.
The patch mythtv-
cleanup_recording_rules_and_oldrecorded_in_housekeeper.patch moves the
non-program-listings cleanup tasks from mythfilldatabase to the
housekeeper. It's a very straightforward patch making use of the new
!DailyCleanup tag.
The patch mythtv-cleanup_program_listings_through_housekeeper.patch
modifies the housekeeper to ensure program listings data get cleaned up as
part of the housekeeper's !DailyCleanup. Rather than move the cleanup
code to the housekeeper, the code was left in mythfilldatabase and
mythfilldatabase was modified to allow running a "--do-cleanup-only" task
which simply performs the cleanup tasks. Then, the housekeeper was
modified to run mythfilldatabase with the "--do-cleanup-only" argument if
!MythFillEnabled is 0 (if Myth doesn't automatically run mythfilldatabase)
using the already in-place MFDThread code modified to allow specifying
mythfilldatabase program and arguments through an MFDStruct argument (also
allows specifying log since it seemed wrong to specify 2 out of 3 and in
case we decide to forego logging of cleanup tasks). The reasoning behind
leaving the listings data cleanup in mythfilldatabase is that the program
that populates the tables should clean them up. The "--do-cleanup-only"
argument is unadvertised (it's "--help" output is #if'ed out and can be
either left as is, enabled, or removed) since its functionality is a
normal part of mythfilldatabase's data grabbing and advertising it is
likely to cause people to think they need to run it manually.
Because mythfilldatabase supports a "--no-delete" argument, which allows
keeping listings data for a week (rather than expiring all listings data
whose starttime was on or before the previous day), the housekeeper calls
"mythfilldatabase --do-cleanup-only --no-delete". The code in
mythfilldatabase that calls clearOldDBEntries() was left intact. That
way, users who run mythfilldatabase on their own may decide to allow
"immediate" expiration of listings data or may specify "--no-delete".
(This is why the housekeeper checks to see if it even needs to run a
"--do-cleanup-only" task.)
In addition, mythtv-cleanup_program_listings_through_housekeeper.patch
also changes the housekeeper to find mythfilldatabase the same way we find
other external myth apps--using GetInstallPrefix() and also modifies the
setting label, default value, and help text, removing the focus on the
path. (This additional change was put in the same patch because of the
amount of conflicts a separate patch would create.)
After one patch is applied, one of the *-after* patches should be used to
apply the second patch. Because of conflicts the patch without the
"after" won't apply after the other "after"-less patch. You'll get some
fuzz, but they apply correctly.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/2544>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list