@cronjobs.register
def purge_tweets():
 pin_this_thread()
 for locale in settings.SUMO_LANGUAGES:
  locale = settings.LOCALES[locale].iso639_1
  if (not locale):
   continue
  oldest = _get_oldest_tweet(locale, settings.CC_MAX_TWEETS)
  if oldest:
   log.debug(('Truncating tweet list: Removing tweets older than %s, for [%s].' % (oldest.created, locale)))
   Tweet.objects.filter(locale=locale, created__lte=oldest.created).delete()

@ cronjobs . register def purge_tweets ( ) : pin_this_thread ( ) for locale in settings . SUMO_LANGUAGES : locale = settings . LOCALES [ locale ] . iso639_1 if ( not locale ) : continue oldest = _get_oldest_tweet ( locale , settings . CC_MAX_TWEETS ) if oldest : log . debug ( ( 'Truncating tweet list: Removing tweets older than %s, for [%s].' % ( oldest . created , locale ) ) ) Tweet . objects . filter ( locale = locale , created__lte = oldest . created ) . delete ( )
periodically purge old tweets for each locale .