Skip to content
Snippets Groups Projects
Commit 824bf3c7 authored by Ravi Tripathi's avatar Ravi Tripathi
Browse files

Added commented out sections to tasks for future use

parent 89de53a6
No related branches found
No related tags found
1 merge request!40Add rabbitmq connection
......@@ -6,21 +6,25 @@ import subprocess
from gevent import monkey
monkey.patch_all(subprocess=True)
broker_url = 'amqp://reggie:reggie@ohpc:5672/'
broker_url = 'amqp://reggie:reggie@ohpc:5672/socketio'
#broker_url = 'amqp://'
celery = Celery('flask_user_reg', broker=broker_url)
# socketio = SocketIO(message_queue='amqp:///socketio')
#socketio = SocketIO(message_queue='amqp:///socketio')
#def send_msg(event, room):
# socketio.emit(event, room=room)
@celery.task
def celery_create_account(username, fullname, reason, room, socketio):
# Todo: Ravi's and Louis's code goes here
print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tUser ' + username + ' added to queue')
#send_msg("creating account", room)
socketio.emit("creating account", room=room)
print(username)
subprocess.call(["/opt/rabbitmq_agents/flask_producer.py", "ohpc_account_create", username])
time.sleep(5)
#time.sleep(5)
print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tAccount successfully created for ' + username)
#send_msg("account ready", room)
socketio.emit('account ready', room=room)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment