+if($pSearchhistory) {
+ print "Purging records older than $pSearchhistory from search_history.\n" if $verbose;
+ PurgeSearchHistory($pSearchhistory);
+ print "Done with purging search_history.\n" if $verbose;
+}
+
+if ($pListShareInvites) {
+ print "Purging unaccepted list share invites older than $pListShareInvites days.\n" if $verbose;
+ $sth = $dbh->prepare("
+ DELETE FROM virtualshelfshares
+ WHERE invitekey IS NOT NULL
+ AND (sharedate + INTERVAL ? DAY) < NOW()
+ ");
+ $sth->execute($pListShareInvites);
+ print "Done with purging unaccepted list share invites.\n" if $verbose;
+}
+