From f990d2a4e007c71b8d42730ade7beca3df71c49d Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Wed, 15 Feb 2023 12:46:48 -0600 Subject: [PATCH] Removing bad database middleware. --- database/middleware.go | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 database/middleware.go diff --git a/database/middleware.go b/database/middleware.go deleted file mode 100644 index 92d5d7e..0000000 --- a/database/middleware.go +++ /dev/null @@ -1,19 +0,0 @@ -package database - -import ( - "github.com/labstack/echo/v4" -) - -// DBTransactionMiddleware will commit a transaction at the end of a request cycle -// Should be placed as high up in the cycle as possible. -func DBTransactionMiddleware(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - res := next(c) - db := ForContext(c.Request().Context()) - db.EnableCommit() - if err := db.CommitTx(); err != nil { - return err - } - return res - } -} -- 2.45.2