Skip to content

Commit bbd4596

Browse files
committed
Increase max distance radius to 250m and make it configurable via constructor
1 parent 088af7e commit bbd4596

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl MatchingConfig {
118118
impl Default for MatchingConfig {
119119
fn default() -> Self {
120120
Self {
121-
max_distance_meters: 5.0, // 5 meter radius
121+
max_distance_meters: 250.0, // 250 meter radius
122122
max_time_diff_ms: 1500, // 1500ms window (increased for server-assigned timestamps)
123123
default_ttl_ms: 500, // 500ms TTL
124124
temporal_weight: 0.7, // Prioritize temporal matching

src/queue/q_core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl UnifiedQueue {
7171
}
7272

7373
/// Creates a new queue with custom time difference configuration
74-
pub fn new_with_config(event_buffer: usize, max_size: usize, max_time_diff_ms: i64) -> Self {
74+
pub fn new_with_config(event_buffer: usize, max_size: usize, max_time_diff_ms: i64, max_distance_meters: f64) -> Self {
7575
let (tx, _) = broadcast::channel(event_buffer);
7676

7777
// Log the max_time_diff_ms value for debugging
@@ -82,7 +82,7 @@ impl UnifiedQueue {
8282
event_tx: tx,
8383
max_size,
8484
max_time_diff_ms,
85-
max_distance_meters: DEFAULT_MAX_DISTANCE_METERS,
85+
max_distance_meters: max_distance_meters,
8686
min_score_without_key: DEFAULT_MIN_SCORE_WITHOUT_KEY,
8787
min_score_with_key: DEFAULT_MIN_SCORE_WITH_KEY,
8888
custom_key_match_bonus: DEFAULT_CUSTOM_KEY_MATCH_BONUS,

src/service.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ impl MatchingService {
3939
queue: Arc::new(UnifiedQueue::new_with_config(
4040
100,
4141
config.max_queue_size,
42-
config.max_time_diff_ms
42+
config.max_time_diff_ms,
43+
config.max_distance_meters // Pass the value from config
4344
)), // Buffer size of 100 events
4445
config,
4546
start_time: Arc::new(Instant::now()),

0 commit comments

Comments
 (0)