Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

(Bug 4570) Inactivate userpics

In order to import everything we can, right now we allow the importer to
exceed the user's userpic quota. This adds a nightly update that goes in and
makes sure the userpic quotas are respected.

This runs as part of the nightly active user job, so it means users will have
up to 24 hours of time above the quota before we fix it.
  • Loading branch information...
commit 4aa54a151a2810a633efc865e9778298e39b1ec5 1 parent eb18aa2
@zorkian zorkian authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 bin/maint/clean_caches.pl
View
15 bin/maint/clean_caches.pl
@@ -207,6 +207,21 @@
$yr, $mo,
$yr );
+ # This is kind of a hack. We have a situation right now where we allow
+ # imports to override the userpic quota for a user, because we want to
+ # import everything we can. But we need a way to, later, go through
+ # and deactivate those userpics. We are doing that here so that the
+ # problem only lasts for a day or so.
+ my $sth = $dbcm->prepare(
+ "SELECT DISTINCT userid FROM active_user $where");
+ $sth->execute(@where_vals);
+ unless ($dbcm->err) {
+ while (my ($uid) = $sth->fetchrow_array) {
+ my $u = LJ::load_userid($uid) or next; # Best effort.
+ $u->activate_userpics;
+ }
+ }
+
# don't need to check for distinct userid in the count here
# because y,m,d,h,uid is the primary key so we know it's
# unique for this hour anyway
Please sign in to comment.
Something went wrong with that request. Please try again.