Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Flask_User_Reg
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
Krish Moodbidri
Flask_User_Reg
Commits
3621d57d
Commit
3621d57d
authored
5 years ago
by
Krish Moodbidri
Browse files
Options
Downloads
Patches
Plain Diff
testing celery message passign
parent
49903e41
Branches
feat-socketio-celery
Tags
v1.0
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/templates/auth/SignUp.html
+1
-1
1 addition, 1 deletion
app/templates/auth/SignUp.html
run.py
+2
-1
2 additions, 1 deletion
run.py
tasks.py
+2
-2
2 additions, 2 deletions
tasks.py
with
5 additions
and
4 deletions
app/templates/auth/SignUp.html
+
1
−
1
View file @
3621d57d
...
...
@@ -105,7 +105,7 @@
<input
class=
"form-control"
id=
"fullname"
name=
"fullname"
placeholder=
"Enter Full Name"
required=
""
type=
"text"
>
<label><b><label
for=
"reason"
>
Reason for Requesting Account:
</label><br></b></label>
<textarea
class=
"form-control"
id=
"reason"
name=
"reason"
placeholder=
"Enter Reason for Account Request"
required=
""
></textarea>
<input
class=
"btn btn-primary btn-block"
id=
"submit"
name=
"submit"
type=
"button"
value=
"Submit"
onclick=
"request_account()"
>
<input
class=
"btn btn-primary btn-block"
id=
"submit"
name=
"submit"
type=
"button"
value=
"Submit"
onclick=
"
displayloading();
request_account()"
>
<div>
<strong
id=
"error"
style=
"color: #be051b; text-align: center;"
></strong>
...
...
This diff is collapsed.
Click to expand it.
run.py
+
2
−
1
View file @
3621d57d
...
...
@@ -31,7 +31,7 @@ def user_connected(json, methods=['GET', 'POST']):
@socketio.on
(
'
request account
'
)
def
request_account
(
json
,
methods
=
[
'
GET
'
,
'
POST
'
]):
socketio
.
emit
(
"
creating account
"
)
print
(
time
.
strftime
(
"
%m-%d-%Y_%H:%M:%S
"
)
+
'
\t
Queue request received:
'
+
str
(
json
))
room
=
str
(
session
[
'
uid
'
])
...
...
@@ -39,6 +39,7 @@ def request_account(json, methods=['GET', 'POST']):
try
:
socketio
.
emit
(
"
creating account
"
)
#create_account(json['username'], json['fullname'], json['reason'])
tasks
.
celery_create_account
(
json
[
'
username
'
],
json
[
'
fullname
'
],
json
[
'
reason
'
],
room
,
socketio
)
...
...
This diff is collapsed.
Click to expand it.
tasks.py
+
2
−
2
View file @
3621d57d
...
...
@@ -11,9 +11,9 @@ celery = Celery('flask_user_reg', broker='amqp://')
@celery.task
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)
time
.
sleep
(
5
)
time
.
sleep
(
10
)
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