Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Krish Moodbidri
self-reg-form
Commits
2b20027d
Commit
2b20027d
authored
Mar 01, 2021
by
root
Browse files
timeout code
parent
6afd3884
Pipeline
#4192
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tasks.py
View file @
2b20027d
...
...
@@ -3,6 +3,9 @@ import time
from
flask_socketio
import
SocketIO
import
subprocess
import
vars
import
sys
sys
.
path
.
append
(
'/cm/shared/rabbitmq_agents/'
)
import
rc_util
from
gevent
import
monkey
...
...
@@ -31,6 +34,19 @@ def celery_create_account(json, session):
send_msg
(
'creating account'
,
room
)
print
(
username
)
rc_util
.
add_account
(
username
,
email
,
fullname
,
reason
)
rc_util
.
consume
(
username
)
print
(
time
.
strftime
(
"%m-%d-%Y_%H:%M:%S"
)
+
'
\t
Account successfully created for '
+
username
)
send_msg
(
'account ready'
,
room
)
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment