blob: 039131f6a4f8b7bf174550bb1222010094bd4f49 [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001# Copyright 2016 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
Copybara854996b2021-09-07 19:36:02 +00004
5"""Classes to handle cron requests to trim users' hotlists/issues visited."""
6from __future__ import print_function
7from __future__ import division
8from __future__ import absolute_import
9
10from framework import jsonfeed
11
Adrià Vilanova Martínezde942802022-07-15 14:06:55 +020012
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +010013class TrimVisitedPages(jsonfeed.InternalTask):
Copybara854996b2021-09-07 19:36:02 +000014
15 """Look for users with more than 10 visited hotlists and deletes extras."""
16
17 def HandleRequest(self, mr):
18 """Delete old RecentHotlist2User rows when there are too many"""
19 self.services.user.TrimUserVisitedHotlists(mr.cnxn)
Adrià Vilanova Martínezde942802022-07-15 14:06:55 +020020
Adrià Vilanova Martínez9f9ade52022-10-10 23:20:11 +020021 def GetTrimVisitedPages(self, **kwargs):
22 return self.handler(**kwargs)