Commit 58653950 authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

WIP:added callback function

parent 3e61295a
Pipeline #4248 failed with stage
......@@ -16,6 +16,9 @@ celery = Celery('flask_user_reg', broker=broker_url)
socketio = SocketIO(message_queue=vars.message_queue)
def callback():
def send_msg(event, room):
print("Post '{}' to room '{}'".format(event,room))
......@@ -35,18 +38,5 @@ def celery_create_account(json, session):
rc_util.add_account(username, email, fullname, reason)
print('sent account info')
# rc_util.consume(username)
# print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tAccount successfully created for ' + username)
# send_msg('account ready', room)
# return
#rc_util.add_account(args.username,, full=args.full_name, reason=args.reason)
#print(f'Account for {args.username} requested.')
# Set initial timeout timer
signal.signal(signal.SIGALRM, timeout_handler)
signal.setitimer(signal.ITIMER_REAL, timeout)
print('Waiting for completion...')
rc_util.consume(args.username, routing_key=f'complete.{args.username}', callback=callback)
rc_util.consume(username, routing_key=f'complete.{username}', callback=callback)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment