diff --git a/tasks.py b/tasks.py index b815bcdbf23da1b1ddd9bbd5d0fd5e5289f8249a..2a1ccc6bd5f2595d0e4e871742dfc8ef87db53f4 100644 --- a/tasks.py +++ b/tasks.py @@ -16,6 +16,9 @@ celery = Celery('flask_user_reg', broker=broker_url) socketio = SocketIO(message_queue=vars.message_queue) +def callback(): + rc_util.rc_rmq.stop_consume() + rc_util.rc_rmq.delete_queue() def send_msg(event, room): print("Post '{}' to room '{}'".format(event,room)) @@ -35,18 +38,5 @@ def celery_create_account(json, session): print(username) 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, email=args.email, 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)