主动清理
This commit is contained in:
parent
e50ca2fd5a
commit
1ca7226cfe
@ -50,7 +50,6 @@ def doClean():
|
|||||||
os.system(config["dow"])
|
os.system(config["dow"])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def getCurrentStatus():
|
def getCurrentStatus():
|
||||||
_disk = psutil.disk_usage("/")
|
_disk = psutil.disk_usage("/")
|
||||||
_mem = psutil.virtual_memory()
|
_mem = psutil.virtual_memory()
|
||||||
|
@ -203,11 +203,10 @@ def fileDownload(path):
|
|||||||
status=code,
|
status=code,
|
||||||
mimetype='application/octet-stream',
|
mimetype='application/octet-stream',
|
||||||
headers={
|
headers={
|
||||||
"Content-Length": os.path.getsize(path)-1-offset,
|
"Content-Length": os.path.getsize(path),
|
||||||
"Content-Range": "bytes {}-{}/{}".format(offset,os.path.getsize(path)-1,os.path.getsize(path)),
|
"Content-Range": "bytes {}-{}/{}".format(offset,os.path.getsize(path)-1,os.path.getsize(path)),
|
||||||
"Accept-Ranges": "bytes",
|
"Accept-Ranges": "bytes",
|
||||||
"Range": "bytes",
|
"Range": "bytes",
|
||||||
"Content-Disposition": "attachment; filename={}".format(path),
|
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
return Response(status=404)
|
return Response(status=404)
|
||||||
|
@ -94,7 +94,9 @@ def upload(date=datetime.strftime(datetime.now(), "%Y_%m_%d")):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
Common.appendError(e.__str__())
|
Common.appendError(e.__str__())
|
||||||
continue
|
continue
|
||||||
os.remove(i)
|
if not Common.forceNotEncode:
|
||||||
|
os.remove(i)
|
||||||
|
Common.doClean()
|
||||||
i = Common.uploadQueue.get()
|
i = Common.uploadQueue.get()
|
||||||
Common.appendUploadStatus("Upload Daemon Quiting")
|
Common.appendUploadStatus("Upload Daemon Quiting")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user