Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jussi
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
jussi
Commits
973fcce6
Commit
973fcce6
authored
1 year ago
by
Dan Notestein
Browse files
Options
Downloads
Patches
Plain Diff
Allow config file to be json5
parent
cafe8423
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Pipfile
+1
-0
1 addition, 0 deletions
Pipfile
Pipfile.lock
+701
-641
701 additions, 641 deletions
Pipfile.lock
jussi/listeners.py
+12
-4
12 additions, 4 deletions
jussi/listeners.py
with
714 additions
and
645 deletions
Pipfile
+
1
−
0
View file @
973fcce6
...
...
@@ -59,6 +59,7 @@ websockets = "*"
async-timeout
=
"*"
funcy
=
"*"
jsonschema
=
"*"
json5
=
"*"
[requires]
python_version
=
"3.6"
This diff is collapsed.
Click to expand it.
Pipfile.lock
+
701
−
641
View file @
973fcce6
This diff is collapsed.
Click to expand it.
jussi/listeners.py
+
12
−
4
View file @
973fcce6
...
...
@@ -9,12 +9,22 @@ import aiohttp
import
async_timeout
import
ujson
import
os
import
json5
from
jussi.ws.pool
import
Pool
from
.cache
import
setup_caches
from
.typedefs
import
WebApp
from
.upstream
import
_Upstreams
def
load_config_file
(
config_filename
):
extension
=
os
.
path
.
splitext
(
config_filename
)
with
open
(
config_filename
)
as
f
:
if
extension
==
'
.json5
'
:
return
json5
.
load
(
f
)
else
:
return
json
.
load
(
f
)
def
setup_listeners
(
app
:
WebApp
)
->
WebApp
:
# pylint: disable=unused-argument, unused-variable
...
...
@@ -34,8 +44,7 @@ def setup_listeners(app: WebApp) -> WebApp:
logger
.
info
(
'
setup_upstreams
'
,
when
=
'
before_server_start
'
)
args
=
app
.
config
.
args
upstream_config_file
=
args
.
upstream_config_file
with
open
(
upstream_config_file
)
as
f
:
upstream_config
=
json
.
load
(
f
)
upstream_config
=
load_config_file
(
upstream_config_file
)
try
:
app
.
config
.
upstreams
=
_Upstreams
(
upstream_config
,
validate
=
args
.
test_upstream_urls
)
...
...
@@ -120,8 +129,7 @@ def setup_listeners(app: WebApp) -> WebApp:
logger
.
info
(
'
setup_limits
'
,
when
=
'
before_server_start
'
)
args
=
app
.
config
.
args
config_file
=
args
.
upstream_config_file
with
open
(
config_file
)
as
f
:
config
=
json
.
load
(
f
)
config
=
load_config_file
(
config_file
)
app
.
config
.
limits
=
config
.
get
(
'
limits
'
,
{
'
accounts_blacklist
'
:
set
()})
app
.
config
.
jsonrpc_batch_size_limit
=
args
.
jsonrpc_batch_size_limit
...
...
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