-
-
Save mihajenko/81f8be41df15f2a818918f9bb3bb9346 to your computer and use it in GitHub Desktop.
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
""" | |
flask related code | |
""" | |
from flask import * | |
from celery_defs import my_background_task | |
def main(): | |
app = Flask(__name__) | |
app.config['CELERY_BROKER_URL'] = 'redis://localhost:6379/0' | |
app.config['CELERY_RESULT_BACKEND'] = 'redis://localhost:6379/0' | |
@app.route('/createServer', methods=['POST']) | |
def createServer(): | |
task = my_background_task.apply_async(args=["test0", "test1"], countdown=10) | |
return jsonify({"status": "done"}) | |
app.run(host='127.0.0.1', port=8080, debug=True) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment