Navigation Menu

Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiemccarthy committed Oct 3, 2004
1 parent 5ac966c commit 977971f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Slash/DB/Static/MySQL/MySQL.pm
Expand Up @@ -321,6 +321,25 @@ sub forgetUsersLogtokens {
"DATE_ADD(expires, INTERVAL 1 MONTH) < NOW()");
}

########################################################
# For daily_forget.pl
sub forgetUsersLastLookTime {
my($self) = @_;
my $constants = getCurrentStatic();
my $reader = getObject('Slash::DB', { db_type => "reader" });
my $min_lastlooktime = time - ($constants->{lastlookmemory} + 86400*7);
my $uids = $reader->sqlSelectColArrayref("uid", "users_param",
"name='lastlooktime' AND value < '$min_lastlooktime'");

my $splice_count = 2000;
while (@$uids) {
my @uid_chunk = splice @$uids, 0, $splice_count;
my $uids_in = join(",", @uid_chunk);
$self->sqlDelete("users_param",
"name IN ('lastlooktime', 'lastlookuid') AND uid IN ($uids_in)");
}
}

########################################################
# For daily_forget.pl
sub forgetCommentIPs {
Expand Down
1 change: 1 addition & 0 deletions themes/slashcode/tasks/daily_forget.pl
Expand Up @@ -19,6 +19,7 @@
my $forgotten2 = $slashdb->forgetSubmissionIPs;
my $forgotten3 = $slashdb->forgetOpenProxyIPs;
my $forgotten4 = $slashdb->forgetUsersLogtokens;
my $forgotten4 = $slashdb->forgetUsersLastLookTime;
return "forgot approx $forgotten1 comment IPs, $forgotten2 submission IPs, $forgotten3 open proxy IPs, $forgotten4 logtokens";
};

Expand Down

0 comments on commit 977971f

Please sign in to comment.