From: Michael Tremer Date: Wed, 29 Jan 2025 10:38:58 +0000 (+0000) Subject: uploads: Manually commit the session X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52508b414e7b61de252e803f246278cd11e2f279;p=pbs.git uploads: Manually commit the session This is required because the session might not be fast enough before the client comes back with the payload. This ensures that we won't have a race. Signed-off-by: Michael Tremer --- diff --git a/src/web/uploads.py b/src/web/uploads.py index 23a33a55..122d03e5 100644 --- a/src/web/uploads.py +++ b/src/web/uploads.py @@ -96,6 +96,9 @@ class APIv1IndexHandler(base.APIMixin, base.BaseHandler): except ValueError as e: raise base.APIError(errno.EINVAL, "%s" % e) from e + # Commit the session before sending the response to the client + await self.db.commit() + # Send the ID of the upload back to the client self.finish({ "id" : "%s" % upload.uuid,