Browse Source

[serve] Make seed request handling async again for now

remotes/src/master
Natalie Pendragon 1 year ago
parent
commit
2b10d9000f
  1. 11
      gus/serve.py

11
gus/serve.py

@ -437,13 +437,14 @@ def add_seed(request):
if request.query:
with open("seed-requests.txt", "a") as seed_file:
seed_file.write("{}\n".format(request.query))
crawl_thread = threading.Thread(name="crawl_thread",
target=crawl_seed_and_restart,
args=(request.query,))
crawl_thread.start()
# crawl_thread = threading.Thread(name="crawl_thread",
# target=crawl_seed_and_restart,
# args=(request.query,))
# crawl_thread.start()
data.extend([
"",
"Thank you for the addition! GUS is crawling and indexing this URL ({}) now, and it will show up in GUS search results as soon as the indexing completes.".format(request.query),
# "Thank you for the addition! GUS is crawling and indexing this URL ({}) now, and it will show up in GUS search results as soon as the indexing completes.".format(request.query),
"Thank you for the addition! GUS usually completes indexing new sites within 24 hours, at which point you should see yours ({}) in GUS search results!".format(request.query),
"",
])
return Response(Status.SUCCESS, "text/gemini", "\n".join(data))

Loading…
Cancel
Save