Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
evm-store
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanli
evm-store
Commits
b91e4e41
Commit
b91e4e41
authored
Jun 11, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a841cc68
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
tools/resources/manager.py
tools/resources/manager.py
+13
-13
tools/resources/webcreator/webscoket.py
tools/resources/webcreator/webscoket.py
+2
-2
No files found.
tools/resources/manager.py
View file @
b91e4e41
...
@@ -23,26 +23,26 @@ def run():
...
@@ -23,26 +23,26 @@ def run():
生产模式启动命令函数
生产模式启动命令函数
To use: python3 manager.py run
To use: python3 manager.py run
"""
"""
app
.
logger
.
setLevel
(
app
.
config
.
get
(
'LOG_LEVEL'
,
logging
.
INFO
))
#
app.logger.setLevel(app.config.get('LOG_LEVEL', logging.INFO))
service_config
=
{
#
service_config = {
'bind'
:
app
.
config
.
get
(
'BIND'
,
'0.0.0.0:3000'
),
#
'bind': app.config.get('BIND', '0.0.0.0:3000'),
'workers'
:
app
.
config
.
get
(
'WORKERS'
,
cpu_count
()
*
2
+
1
),
#
'workers': app.config.get('WORKERS', cpu_count() * 2 + 1),
'worker_class'
:
'gevent'
,
#
'worker_class': 'gevent',
'worker_connections'
:
app
.
config
.
get
(
'WORKER_CONNECTIONS'
,
10000
),
#
'worker_connections': app.config.get('WORKER_CONNECTIONS', 10000),
'backlog'
:
app
.
config
.
get
(
'BACKLOG'
,
2048
),
#
'backlog': app.config.get('BACKLOG', 2048),
'timeout'
:
app
.
config
.
get
(
'TIMEOUT'
,
60
),
#
'timeout': app.config.get('TIMEOUT', 60),
'loglevel'
:
app
.
config
.
get
(
'LOG_LEVEL'
,
'info'
),
#
'loglevel': app.config.get('LOG_LEVEL', 'info'),
'pidfile'
:
app
.
config
.
get
(
'PID_FILE'
,
'run.pid'
),
#
'pidfile': app.config.get('PID_FILE', 'run.pid'),
}
#
}
http_server
=
HTTPServer
(
WSGIContainer
(
app
))
http_server
=
HTTPServer
(
WSGIContainer
(
app
))
http_server
.
listen
(
3000
)
http_server
.
listen
(
3000
,
address
=
'127.0.0.1'
)
# wsgi_app = WSGIContainer(app)
# wsgi_app = WSGIContainer(app)
# application = Application([
# application = Application([
# (r'.*', FallbackHandler, dict(fallback=wsgi_app))
# (r'.*', FallbackHandler, dict(fallback=wsgi_app))
# ], **service_config)
# ], **service_config)
# application.listen(3000
, address='127.0.0.1'
)
# application.listen(3000)
IOLoop
.
instance
()
.
start
()
IOLoop
.
instance
()
.
start
()
...
...
tools/resources/webcreator/webscoket.py
View file @
b91e4e41
...
@@ -28,12 +28,12 @@ def pushmessage(func):
...
@@ -28,12 +28,12 @@ def pushmessage(func):
try
:
try
:
if
isinstance
(
msg
,
WebsocketResponse
)
or
isinstance
(
msg
,
dict
):
if
isinstance
(
msg
,
WebsocketResponse
)
or
isinstance
(
msg
,
dict
):
self
.
write_message
(
json
.
dumps
(
msg
),
binary
)
self
.
write_message
(
json
.
dumps
(
msg
),
binary
)
elif
isinstance
(
msg
,
str
)
or
isinstance
(
msg
,
unicode
):
elif
isinstance
(
msg
,
str
)
or
isinstance
(
msg
,
str
):
self
.
write_message
(
msg
,
binary
)
self
.
write_message
(
msg
,
binary
)
else
:
else
:
self
.
write_message
(
repr
(
msg
),
binary
)
self
.
write_message
(
repr
(
msg
),
binary
)
except
WebSocketClosedError
as
e
:
except
WebSocketClosedError
as
e
:
logger
.
error
(
e
)
self
.
on_close
()
self
.
on_close
()
return
send
return
send
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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