def post_auth_success(self): action_taken = "Unrecognized command" command = self.request.get("command") if command == "Run anonymizer now": try: log.info("Queuing anonymizer task (interactive request)") driver.queue() action_taken = "Manual anonymizer run scheduled, see server log for details" except Exception as e: #pylint: disable=broad-except,invalid-name action_taken = e if command == "Clear stuck batch job": try: log.info("Queuing clear batch task (interactive request)") driver.queue_unstick() action_taken = "Clearing stuck batch job, see server log for details" except Exception as e: #pylint: disable=broad-except,invalid-name action_taken = e self.render("utilities.html", action_taken=action_taken)
def get(self): log.info("Queueing anonymizer task (cron request)") driver.queue() self.response.out.write("Success")
def test_queue_up_driver(self): driver.queue() tasks = self.taskqueue_stub.get_filtered_tasks() self.assertEqual(len(tasks), 1)