use a fresh spooldb session per image instead of a shared one
This commit is contained in:
@@ -15,9 +15,10 @@ import (
|
||||
//go:embed index.html
|
||||
var indexHTML []byte
|
||||
|
||||
// serve runs the mobile putaway web server. Requests are serialized because the
|
||||
// shared spooldb browser session is single-threaded.
|
||||
func serve(addr string, auth claude.Auth, sp *spoolSync, dryRun bool) error {
|
||||
// serve runs the mobile putaway web server. Each request gets its own fresh
|
||||
// spooldb session; requests are serialized so we never run several headless
|
||||
// browsers at once.
|
||||
func serve(addr string, auth claude.Auth, dryRun bool) error {
|
||||
var mu sync.Mutex
|
||||
|
||||
mux := http.NewServeMux()
|
||||
@@ -53,7 +54,7 @@ func serve(addr string, auth claude.Auth, sp *spoolSync, dryRun bool) error {
|
||||
|
||||
start := time.Now()
|
||||
mu.Lock()
|
||||
res := processImg(img, hdr.Filename, auth, sp, dryRun)
|
||||
res := processImg(img, hdr.Filename, auth, dryRun)
|
||||
mu.Unlock()
|
||||
slog.Info("processed upload", "file", hdr.Filename, "spool", res.SpoolID, "dur", time.Since(start))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user