blob: fb5f84a5fb81ddecd7dfa82f3429d31575eb300a [file] [log] [blame]
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is govered by a BSD-style
# license that can be found in the LICENSE file or at
"""Implementation of the filter rules feature."""
import logging
from features import filterrules_helpers
from framework import jsonfeed
from tracker import tracker_constants
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,
upper_bound=mr.upper_bound, shard_id=mr.shard_id)
return {
'success': True,
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 the reindex table."""
num_reindexed =
mr.cnxn, tracker_constants.MAX_ISSUES_TO_REINDEX_PER_MINUTE,
return {
'num_reindexed': num_reindexed,