日志记录逻辑
This commit is contained in:
parent
e066048e9f
commit
e77fa5d6ad
@ -47,9 +47,10 @@ def getCurrentStatus():
|
||||
os.system("rm -f `find . -ctime 1 -name '*.flv'`")
|
||||
_mem = psutil.virtual_memory()
|
||||
_net = psutil.net_io_counters()
|
||||
if 60 > getTimeDelta(datetime.now(),network["currentTime"]) > 0:
|
||||
_outSpeed = (_net.bytes_sent - network["out"]["currentByte"])/getTimeDelta(datetime.now(),network["currentTime"])
|
||||
_inSpeed = (_net.bytes_recv - network["in"]["currentByte"])/getTimeDelta(datetime.now(),network["currentTime"])
|
||||
_delta= getTimeDelta(datetime.now(),network["currentTime"])
|
||||
if 60 > _delta > 0:
|
||||
_inSpeed = (_net.bytes_recv - network["in"]["currentByte"])/_delta
|
||||
_outSpeed = (_net.bytes_sent - network["out"]["currentByte"])/_delta
|
||||
else:
|
||||
_outSpeed = 0
|
||||
_inSpeed = 0
|
||||
|
@ -32,6 +32,7 @@ def readConfig():
|
||||
@app.route("/config", methods=["POST"])
|
||||
def writeConfig():
|
||||
# TODO : 完善
|
||||
Common.appendOperation("更新配置")
|
||||
Common.reloadConfig()
|
||||
return jsonify({"message":"ok","code":200,"status":0,"data":request.form})
|
||||
|
||||
|
@ -336,7 +336,7 @@ class Bilibili:
|
||||
"order_id": 0,
|
||||
"videos": self.videos}
|
||||
)
|
||||
Common.appendUploadStatus("[{}] Published | Result : {}".format(title, r.text))
|
||||
Common.modifyLastUploadStatus("[{}] Published | Result : {}".format(title, r.text))
|
||||
|
||||
def reloadFromPrevious(self):
|
||||
if os.path.exists("uploaded.json"):
|
||||
|
@ -37,6 +37,7 @@ def download(url):
|
||||
f.close()
|
||||
isDownload = False
|
||||
if os.path.getsize(path) < 1024 * 1024:
|
||||
Common.modifyLastDownloadStatus("Downloaded File >{}< is too small, will ignore it".format(path))
|
||||
os.remove(path)
|
||||
return False
|
||||
if Common.forceNotDownload:
|
||||
|
@ -18,6 +18,7 @@
|
||||
{% endfor %}
|
||||
</table>
|
||||
<hr/>
|
||||
<h3><a href="/">录播信息页</a></h3>
|
||||
{% include 'device.html' %}
|
||||
</div>
|
||||
</body>
|
||||
|
@ -50,28 +50,29 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>下载日志</td>
|
||||
<td><span id="download"></span></td>
|
||||
<td colspan="2"><span id="download"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>转码日志</td>
|
||||
<td>转码队列<br><span id="encodeQueueSize"></span></td>
|
||||
<td><span id="encode"></span></td>
|
||||
<td>转码队列<span id="encodeQueueSize"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>上传日志</td>
|
||||
<td>上传队列<br><span id="uploadQueueSize"></span></td>
|
||||
<td><span id="upload"></span></td>
|
||||
<td>上传队列<span id="uploadQueueSize"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>错误日志</td>
|
||||
<td><span id="error"></span></td>
|
||||
<td colspan="2"><span id="error"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>操作日志</td>
|
||||
<td><span id="operation"></span></td>
|
||||
<td colspan="2"><span id="operation"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr/>
|
||||
<h3><a href="/files/">所有录播文件</a></h3>
|
||||
{% include 'device.html' %}
|
||||
</div>
|
||||
<script src="../static/index.js"></script>
|
||||
|
Reference in New Issue
Block a user