Skip to content
Snippets Groups Projects
Commit 2b20027d authored by root's avatar root
Browse files

timeout code

parent 6afd3884
No related branches found
No related tags found
No related merge requests found
Pipeline #4192 canceled with stage
...@@ -3,6 +3,9 @@ import time ...@@ -3,6 +3,9 @@ import time
from flask_socketio import SocketIO from flask_socketio import SocketIO
import subprocess import subprocess
import vars import vars
import sys
sys.path.append('/cm/shared/rabbitmq_agents/')
import rc_util import rc_util
from gevent import monkey from gevent import monkey
...@@ -31,6 +34,19 @@ def celery_create_account(json, session): ...@@ -31,6 +34,19 @@ def celery_create_account(json, session):
send_msg('creating account', room) send_msg('creating account', room)
print(username) print(username)
rc_util.add_account(username, email, fullname, reason) rc_util.add_account(username, email, fullname, reason)
rc_util.consume(username) print('sent account info')
print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tAccount successfully created for ' + username)
send_msg('account ready', room) # 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)
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