blob: 724d7e2857275dc30168404d7cc92eff566ed854 [file] [log] [blame]
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
"""Implementation of the filter rules feature."""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import logging
from features import filterrules_helpers
from framework import jsonfeed
from tracker import tracker_constants
# TODO: change to FlaskInternalTask when convert to flask
class RecomputeDerivedFieldsTask(jsonfeed.InternalTask):
"""JSON servlet that recomputes derived fields on a batch of issues."""
def HandleRequest(self, mr):
"""Recompute derived field values on one range of issues in a shard."""
'params are %r %r %r %r', mr.specified_project_id, mr.lower_bound,
mr.upper_bound, mr.shard_id)
project =
mr.cnxn, mr.specified_project_id)
config =
mr.cnxn, mr.specified_project_id)
mr.cnxn,, project, config, lower_bound=mr.lower_bound,
return {
'success': True,
# def GetRecomputeDerivedFieldsTask(self, **kwargs):
# return self.handler(**kwargs)
# def PostRecomputeDerivedFieldsTask(self, **kwargs):
# return self.handler(**kwargs)
# TODO: change to FlaskInternalTask when convert to Flask
class ReindexQueueCron(jsonfeed.InternalTask):
"""JSON servlet that reindexes some issues each minute, as needed."""
def HandleRequest(self, mr):
"""Reindex issues that are listed in the reindex table."""
num_reindexed =
mr.cnxn, tracker_constants.MAX_ISSUES_TO_REINDEX_PER_MINUTE,
return {
'num_reindexed': num_reindexed,
# def GetReindexQueueCron(self, **kwargs):
# return self.handler(**kwargs)
# def PostReindexQueueCron(self, **kwargs):
# return self.handler(**kwargs)