cleaned up main module

This commit is contained in:
2026-01-02 19:50:10 +11:00
parent 1bcdf0e813
commit 4a21ba3821
7 changed files with 63 additions and 90 deletions

View File

@@ -4,7 +4,6 @@ import (
"context"
"database/sql"
"net/http"
"sync/atomic"
"time"
"projectreshoot/internal/config"
@@ -104,7 +103,6 @@ func Authentication(
conn *sql.DB,
tokenGen *jwt.TokenGenerator,
next http.Handler,
maint *uint32,
) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/static/css/output.css" ||
@@ -114,9 +112,6 @@ func Authentication(
}
ctx, cancel := context.WithTimeout(r.Context(), 10*time.Second)
defer cancel()
if atomic.LoadUint32(maint) == 1 {
cancel()
}
// Start the transaction
tx, err := conn.BeginTx(ctx, nil)