Skip to content

Commit 38275bc

Browse files
committed
fix tests
1 parent e8b82ce commit 38275bc

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

cmd/searchserver/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ func main() {
7777
Config: cfg,
7878
}
7979
anagramServer := &anagramserver.Server{
80-
Config: &wglconfig.Config{DataPath: cfg.DataPath},
80+
Config: &wglconfig.Config{DataPath: cfg.DataPath},
81+
WDBConfig: cfg,
8182
}
8283
wordSearchServer := &searchserver.WordSearchServer{
8384
Config: cfg,

internal/anagramserver/server.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ const (
2828
)
2929

3030
type Server struct {
31-
Config *wglconfig.Config
31+
Config *wglconfig.Config
32+
WDBConfig *config.Config
3233
}
3334

3435
func timeTrack(start time.Time, name string) {
@@ -108,12 +109,8 @@ func (s *Server) Anagram(ctx context.Context, req *connect.Request[pb.AnagramReq
108109
var words []*pb.Word
109110
if req.Msg.Expand && len(sols) > 0 {
110111
// Build an expand request.
111-
112-
// searchServer needs a *config.Config
113-
cfg := &config.Config{}
114-
cfg.DataPath = s.Config.DataPath
115112
expander := &searchserver.Server{
116-
Config: cfg,
113+
Config: s.WDBConfig,
117114
}
118115
alphagram := &pb.Alphagram{
119116
Alphagram: req.Msg.Letters, // not technically an alphagram but doesn't matter rn

internal/wordvault/server_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ var DefaultConfig = &config.Config{
3232
DBMigrationsPath: os.Getenv("DB_MIGRATIONS_PATH"),
3333
MaxNonmemberCards: 10000,
3434
MaxCardsAdd: 1000,
35+
MaxQueryResults: 50000,
3536
}
3637

3738
func testDBURI(useDBName bool) string {

0 commit comments

Comments
 (0)