Created
October 31, 2017 19:25
-
-
Save WillianFuks/be439f6b72f4c390b60a1c17b7ed5431 to your computer and use it in GitHub Desktop.
Main application to receive CRON requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from flask import Flask, request | |
from google.appengine.api import taskqueue | |
from utils import process_url_date | |
app = Flask(__name__) | |
@app.route("/export_customers") | |
def export_customers(): | |
"""When this method is invoked a new task is added to the queue where | |
eventually data from BigQuery is exported to GCS. | |
""" | |
date = process_url_date(request.args) | |
task = taskqueue.add(url='/queue_export', | |
target='worker', | |
params={'date': date}) | |
return "Taks {} enqued, ETA {}".format(task.name, task.eta) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment