'Called when a new request is arrived'

def on_new_request(self, task):

    task['status'] = self.taskdb.ACTIVE
    self.insert_task(task)
    self.put_task(task)
    project = task['project']
    self._cnt['5m'].event((project, 'pending'), (+ 1))
    self._cnt['1h'].event((project, 'pending'), (+ 1))
    self._cnt['1d'].event((project, 'pending'), (+ 1))
    self._cnt['all'].event((project, 'pending'), (+ 1))
    logger.info('new    task    %(project)s:%(taskid)s    %(url)s', task)
    return task
