Archived
更新一些小细节
This commit is contained in:
4 files changed
+5
-8
No files matched your search
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
* 上方的计数器为不更新版本只保留了最基本的功能
|
* 上方的计数器为不更新版本只保留了最基本的功能
|
||||||
|
|
||||||
## Python 版访问次数计数器使用了flask 作为服务端接收请求
|
## Python 版访问次数计数器 使用了flask 作为服务端接收请求
|
||||||
|
|
||||||
* [文档](https://request-counter-docs.vercel.app/#/)
|
* [文档](https://request-counter-docs.vercel.app/#/)
|
||||||
|
|
||||||
|
|||||||
@@ -6,19 +6,18 @@
|
|||||||
# @File Name: app.py
|
# @File Name: app.py
|
||||||
|
|
||||||
|
|
||||||
|
from gevent import pywsgi
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask import Response
|
from flask import Response
|
||||||
from flask import request
|
from flask import request
|
||||||
from flask import make_response
|
from flask import make_response
|
||||||
from flask import render_template
|
from flask import render_template
|
||||||
from gevent import pywsgi
|
|
||||||
from bin.utils.logger import logger
|
from bin.utils.logger import logger
|
||||||
from bin.utils.features import Features
|
from bin.utils.features import Features
|
||||||
from bin.utils.settings import Settings
|
from bin.utils.settings import Settings
|
||||||
from bin.utils.error import ErrorProcess
|
from bin.utils.error import ErrorProcess
|
||||||
from bin.utils.view import view_template
|
from bin.utils.view import view_template
|
||||||
|
|
||||||
|
|
||||||
conf = Settings()
|
conf = Settings()
|
||||||
|
|
||||||
if conf.type.lower() == 'mysql':
|
if conf.type.lower() == 'mysql':
|
||||||
|
|||||||
+3
-3
@@ -118,12 +118,12 @@ if __name__ != '__main__':
|
|||||||
if not os.path.exists('./bin/db/data.db'):
|
if not os.path.exists('./bin/db/data.db'):
|
||||||
logger.warning('数据库文件不存在, 即将开始下载')
|
logger.warning('数据库文件不存在, 即将开始下载')
|
||||||
try:
|
try:
|
||||||
main('https://filebase.vercel.app/data.db', 'data.db', './bin/db/')
|
main('https://filebase.vercel.app/download/data.db', 'data.db', './bin/db/')
|
||||||
except requests.Timeout:
|
except requests.Timeout:
|
||||||
logger.critical('连接超时, 将使用单线程重新尝试下载')
|
logger.critical('连接超时, 将使用单线程重新尝试下载')
|
||||||
try:
|
try:
|
||||||
download('https://filebase.vercel.app/data.db')
|
download('https://filebase.vercel.app/download/data.db')
|
||||||
except requests.Timeout:
|
except requests.Timeout:
|
||||||
logger.critical('连接超时, 请自行前往 https://filebase.vercel.app/data.db 下载文件')
|
logger.critical('连接超时, 请自行前往 https://filebase.vercel.app/download/data.db 下载文件')
|
||||||
logger.critical('并放置在 ./bin/db/ 文件夹内')
|
logger.critical('并放置在 ./bin/db/ 文件夹内')
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
@@ -14,8 +14,6 @@
|
|||||||
a{
|
a{
|
||||||
color: green;
|
color: green;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user