diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2025-07-28 23:58:07 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2025-07-28 23:58:07 -0400 |
| commit | 0c9444f45bf8777b3ef21850d4839dbb8b10aba0 (patch) | |
| tree | 904a79c99958b9e89eb764d2226f10dd3ed42e62 /pkg/server/unix.go | |
| parent | 209af758b64d586e1c0aec3ad2eb4b56740aeddf (diff) | |
Remove todo contexts
Diffstat (limited to 'pkg/server/unix.go')
| -rw-r--r-- | pkg/server/unix.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/server/unix.go b/pkg/server/unix.go index a46320d..9d8c266 100644 --- a/pkg/server/unix.go +++ b/pkg/server/unix.go @@ -6,6 +6,7 @@ import ( "log/slog" "net" "sync" + "time" "github.com/jpappel/atlas/pkg/data" "github.com/jpappel/atlas/pkg/index" @@ -128,15 +129,18 @@ func (s *UnixServer) handleConn(conn *net.UnixConn, id uint64) { break } - docs, err := s.Db.Execute(artifact) + ctx, cancel := context.WithTimeout(context.Background(), 400*time.Millisecond) + docs, err := s.Db.Execute(ctx, artifact) if err != nil { slog.Warn("Failed to execute query", slog.String("query", queryTxt), slog.String("err", err.Error()), ) s.writeError(conn, "query execution error") + cancel() break } + cancel() slog.Debug("Sending results") s.writeResults(conn, docs) |
