Merge branch 'maintenance' into devel

This commit is contained in:
GitHub Nightly Merge Action committed 2023-12-05 00:12:36 +00:00
commit 02939367da
4 files changed
+33 -55

No files matched your search

+12 -8
View File
@@ -2,6 +2,7 @@ __author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import asyncio
import logging
import mimetypes
import os
@@ -311,6 +312,7 @@ class UploadStorageFallbackHandler(RequestlessExceptionLoggingMixin, CorsSupport
else:
self._fallback(self.request, b"")
self._finished = True
self.on_finish()
def data_received(self, chunk):
"""
@@ -591,10 +593,12 @@ class UploadStorageFallbackHandler(RequestlessExceptionLoggingMixin, CorsSupport
result = self._fallback(self.request, body)
if result is not None:
await result
# self._headers_written = True
finally:
# make sure the temporary files are removed again
self._cleanup_files()
self._finished = True
self.on_finish()
def on_finish(self):
self._cleanup_files()
def _cleanup_files(self):
"""
@@ -923,8 +927,7 @@ class CustomHTTP1ServerConnection(tornado.http1connection.HTTP1ServerConnection)
otherwise the same as ``tornado.http1connection.HTTP1ServerConnection``.
"""
@tornado.gen.coroutine
def _server_request_loop(self, delegate):
async def _server_request_loop(self, delegate):
try:
while True:
conn = CustomHTTP1Connection(
@@ -932,10 +935,11 @@ class CustomHTTP1ServerConnection(tornado.http1connection.HTTP1ServerConnection)
)
request_delegate = delegate.start_request(self, conn)
try:
ret = yield conn.read_response(request_delegate)
ret = await conn.read_response(request_delegate)
except (
tornado.iostream.StreamClosedError,
tornado.iostream.UnsatisfiableReadError,
asyncio.CancelledError,
):
return
except tornado.http1connection._QuietException:
@@ -950,7 +954,7 @@ class CustomHTTP1ServerConnection(tornado.http1connection.HTTP1ServerConnection)
return
if not ret:
return
yield tornado.gen.moment
await asyncio.sleep(0)
finally:
delegate.on_close(self)
@@ -974,7 +978,7 @@ class CustomHTTP1Connection(tornado.http1connection.HTTP1Connection):
self._max_body_sizes = list(
map(
lambda x: (x[0], re.compile(x[1]), x[2]),
self.params.max_body_sizes or list(),
self.params.max_body_sizes or [],
)
)
self._default_max_body_size = (
+1 -1
View File
@@ -655,7 +655,7 @@ function cleanTemperature(temp, offThreshold) {
}
function formatTemperature(temp, showF, offThreshold, returnUnicode) {
if (temp === undefined || isNaN(temp)) return "-";
if (temp === undefined || !_.isNumber(temp) || isNaN(temp)) return "-";
if (offThreshold !== undefined && temp < offThreshold) return gettext("off");
var degreeSymbol = "&deg;";