Skip to content

Commit 9fe8d5e

Browse files
authored
Dont change shard unless you know (#195)
1 parent 0524787 commit 9fe8d5e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/query_router.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,14 @@ impl QueryRouter {
335335
// or discard shard selection. If they point to the same shard though,
336336
// we can let them through as-is.
337337
// This is basically building a database now :)
338-
self.active_shard = self.infer_shard(query);
339-
debug!("Automatically using shard: {:?}", self.active_shard);
338+
match self.infer_shard(query) {
339+
Some(shard) => {
340+
self.active_shard = Some(shard);
341+
debug!("Automatically using shard: {:?}", self.active_shard);
342+
}
343+
344+
None => (),
345+
};
340346
}
341347

342348
None => (),

0 commit comments

Comments
 (0)