Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: appengine/swarming/server/task_scheduler.py

Issue 2006263005: Urgent: disable search API. (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/server/task_scheduler.py
diff --git a/appengine/swarming/server/task_scheduler.py b/appengine/swarming/server/task_scheduler.py
index 58c5d7907f49e7cbd50cd7402cf2968acd8a6a30..8543675dc4b13c55a17b7517b2884225fe63e506 100644
--- a/appengine/swarming/server/task_scheduler.py
+++ b/appengine/swarming/server/task_scheduler.py
@@ -14,7 +14,7 @@ import math
import random
from google.appengine.api import datastore_errors
-from google.appengine.api import search
+#from google.appengine.api import search
from google.appengine.ext import ndb
from google.appengine.runtime import apiproxy_errors
@@ -416,15 +416,15 @@ def schedule_request(request):
# created_ts ordering. This is useful because DateField is precise to the date
# (!) and NumberField is signed 32 bits so the best it could do with EPOCH is
# second resolution up to year 2038.
- index = search.Index(name='requests')
- packed = task_pack.pack_result_summary_key(result_summary.key)
- doc = search.Document(
- fields=[
- search.TextField(name='name', value=request.name),
- search.AtomField(name='id', value=packed),
- ])
+ #index = search.Index(name='requests')
+ #packed = task_pack.pack_result_summary_key(result_summary.key)
+ #doc = search.Document(
+ # fields=[
+ # search.TextField(name='name', value=request.name),
+ # search.AtomField(name='id', value=packed),
+ # ])
# Even if it fails here, we're still fine, as the task is not "alive" yet.
- search_future = index.put_async([doc])
+ #search_future = index.put_async([doc])
now = utils.utcnow()
@@ -483,11 +483,11 @@ def schedule_request(request):
if parent_task_keys:
futures.append(datastore_utils.transaction_async(run_parent))
- try:
- search_future.get_result()
- except search.Error:
- # Do not abort the task, for now search is best effort.
- logging.exception('Put failed')
+ #try:
+ # search_future.get_result()
+ #except search.Error:
+ # # Do not abort the task, for now search is best effort.
+ # logging.exception('Put failed')
for future in futures:
# Check for failures, it would raise in this case, aborting the call.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698