Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style |
| 3 | # license that can be found in the LICENSE file or at |
| 4 | # https://developers.google.com/open-source/licenses/bsd |
| 5 | |
| 6 | """Classes to handle cron requests to trim users' hotlists/issues visited.""" |
| 7 | from __future__ import print_function |
| 8 | from __future__ import division |
| 9 | from __future__ import absolute_import |
| 10 | |
| 11 | from framework import jsonfeed |
| 12 | |
Adrià Vilanova Martínez | de94280 | 2022-07-15 14:06:55 +0200 | [diff] [blame^] | 13 | |
| 14 | # TODO: change to FlaskInternalTask when convert to Flask |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 15 | class TrimVisitedPages(jsonfeed.InternalTask): |
| 16 | |
| 17 | """Look for users with more than 10 visited hotlists and deletes extras.""" |
| 18 | |
| 19 | def HandleRequest(self, mr): |
| 20 | """Delete old RecentHotlist2User rows when there are too many""" |
| 21 | self.services.user.TrimUserVisitedHotlists(mr.cnxn) |
Adrià Vilanova Martínez | de94280 | 2022-07-15 14:06:55 +0200 | [diff] [blame^] | 22 | |
| 23 | # def GetTrimVisitedPages(self, **kwargs): |
| 24 | # return self.handler(**kwargs) |
| 25 | |
| 26 | # def PostTrimVisitedPages(self, **kwargs): |
| 27 | # return self.handler(**kwargs) |