Skip to content
GitLab
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
58653950
Commit
58653950
authored
Mar 09, 2021
by
Krish Moodbidri
Browse files
WIP:added callback function
parent
3e61295a
Pipeline
#4248
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tasks.py
View file @
58653950
...
...
@@ -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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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