Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
account_init_cleanup
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mitchell Moore
account_init_cleanup
Commits
b7b2a44c
Commit
b7b2a44c
authored
5 years ago
by
Cloud User
Browse files
Options
Downloads
Patches
Plain Diff
Adding a process to start account creation process by calling flask_producer script
parent
f197dbb2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tasks.py
+7
-1
7 additions, 1 deletion
tasks.py
with
7 additions
and
1 deletion
tasks.py
+
7
−
1
View file @
b7b2a44c
from
celery
import
Celery
import
time
from
flask_socketio
import
SocketIO
import
subprocess
from
gevent
import
monkey
monkey
.
patch_all
(
subprocess
=
True
)
celery
=
Celery
(
'
flask_user_reg
'
,
broker
=
'
amqp://
'
)
broker_url
=
'
amqp://reggie:reggie@ohpc:5672/
'
#broker_url = 'amqp://'
celery
=
Celery
(
'
flask_user_reg
'
,
broker
=
broker_url
)
# socketio = SocketIO(message_queue='amqp:///socketio')
...
...
@@ -14,6 +18,8 @@ def celery_create_account(username, fullname, reason, room, socketio):
# Todo: Ravi's and Louis's code goes here
print
(
time
.
strftime
(
"
%m-%d-%Y_%H:%M:%S
"
)
+
'
\t
User
'
+
username
+
'
added to queue
'
)
socketio
.
emit
(
"
creating account
"
,
room
=
room
)
print
(
username
)
subprocess
.
call
([
"
/opt/rabbitmq_agents/flask_producer.py
"
,
"
ohpc_account_create
"
,
username
])
time
.
sleep
(
5
)
print
(
time
.
strftime
(
"
%m-%d-%Y_%H:%M:%S
"
)
+
'
\t
Account successfully created for
'
+
username
)
socketio
.
emit
(
'
account ready
'
,
room
=
room
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment