Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pikatasks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
django
pikatasks
Commits
e4e8f7b4
Commit
e4e8f7b4
authored
7 years ago
by
Art
Browse files
Options
Downloads
Patches
Plain Diff
Add config for SSL and broker port. Not sure whether SSL works though.
parent
73f20f7c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pikatasks/settings.py
+11
-1
11 additions, 1 deletion
pikatasks/settings.py
pikatasks/utils.py
+8
-2
8 additions, 2 deletions
pikatasks/utils.py
with
19 additions
and
3 deletions
pikatasks/settings.py
+
11
−
1
View file @
e4e8f7b4
...
@@ -11,7 +11,8 @@ from datetime import timedelta
...
@@ -11,7 +11,8 @@ from datetime import timedelta
# stuff you want to change:
# stuff you want to change:
BROKER
=
"
localhost
"
BROKER_HOST
=
"
localhost
"
BROKER_PORT
=
"
5672
"
VIRTUAL_HOST
=
"
vhost
"
VIRTUAL_HOST
=
"
vhost
"
USERNAME
=
"
user
"
USERNAME
=
"
user
"
PASSWORD
=
"
password
"
PASSWORD
=
"
password
"
...
@@ -20,6 +21,15 @@ CLIENT_EXCHANGE_NAME = "" # empty string -> amq.default exchange
...
@@ -20,6 +21,15 @@ CLIENT_EXCHANGE_NAME = "" # empty string -> amq.default exchange
WORKER_TASK_PROCESSES
=
10
# this many processes will be executing tasks
WORKER_TASK_PROCESSES
=
10
# this many processes will be executing tasks
SSL_ENABLED
=
True
SSL_CONF
=
{
# # See ssl.wrap_socket() documentation: https://docs.python.org/3.6/library/ssl.html#ssl.wrap_socket
# "keyfile": "/foo/client/key.pem",
# "certfile": "/foo/client/cert.pem",
# "ca_certs": "/foo/ca/cacert.pem",
# "ssl_version": ssl.PROTOCOL_TLSv1_2,
# "cert_reqs": ssl.CERT_NONE,
}
# stuff you might want to change sometimes:
# stuff you might want to change sometimes:
RPC_TIMEOUT
=
timedelta
(
seconds
=
10
)
# affects client behaviour and message TTL
RPC_TIMEOUT
=
timedelta
(
seconds
=
10
)
# affects client behaviour and message TTL
...
...
This diff is collapsed.
Click to expand it.
pikatasks/utils.py
+
8
−
2
View file @
e4e8f7b4
...
@@ -17,10 +17,16 @@ def deserialize(binary):
...
@@ -17,10 +17,16 @@ def deserialize(binary):
def
get_pika_connection_parameters
():
def
get_pika_connection_parameters
():
return
pika
.
ConnectionParameters
(
return
pika
.
ConnectionParameters
(
host
=
settings
.
BROKER
,
host
=
settings
.
BROKER_HOST
,
port
=
int
(
settings
.
BROKER_PORT
),
virtual_host
=
settings
.
VIRTUAL_HOST
,
virtual_host
=
settings
.
VIRTUAL_HOST
,
credentials
=
pika
.
PlainCredentials
(
username
=
settings
.
USERNAME
,
password
=
settings
.
PASSWORD
),
credentials
=
pika
.
PlainCredentials
(
username
=
settings
.
USERNAME
,
password
=
settings
.
PASSWORD
),
blocked_connection_timeout
=
settings
.
BLOCKED_CONNECTION_TIMEOUT
.
total_seconds
(),
# TODO: causes a warning when closing connections
blocked_connection_timeout
=
settings
.
BLOCKED_CONNECTION_TIMEOUT
.
total_seconds
(),
# TODO: causes a warning when closing connections
ssl
=
settings
.
SSL_ENABLED
,
ssl_options
=
settings
.
SSL_CONF
,
)
)
...
...
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