kopia lustrzana https://github.com/snarfed/bridgy-fed
common.create_task: only log in local server, don't actually create task
rodzic
ee3b72fb1e
commit
efcd2d89b4
|
@ -13,6 +13,7 @@ from Crypto.Util import number
|
|||
from flask import abort, g, make_response, request
|
||||
from oauth_dropins.webutil import util, webmention
|
||||
from oauth_dropins.webutil.appengine_config import tasks_client
|
||||
from oauth_dropins.webutil import appengine_info
|
||||
from oauth_dropins.webutil.appengine_info import APP_ID, DEBUG
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -229,6 +230,10 @@ def create_task(queue, **params):
|
|||
params: form-encoded and included in the task request body
|
||||
"""
|
||||
assert queue
|
||||
|
||||
if appengine_info.LOCAL_SERVER:
|
||||
logger.info(f'Would add task: {queue} {params}')
|
||||
else:
|
||||
task = tasks_client.create_task(
|
||||
parent=tasks_client.queue_path(APP_ID, TASKS_LOCATION, queue),
|
||||
task={
|
||||
|
|
Ładowanie…
Reference in New Issue