Skip to content

Commit

Permalink
potential/fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rupakkorde committed Dec 19, 2024
1 parent c125f5a commit 7d9d180
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: CI

permissions:
contents: read
packages: write
contents: read
packages: write

on:
push:
Expand Down Expand Up @@ -34,13 +34,11 @@ jobs:

- name: Docker tasks
id: docker
if: (github.ref == 'refs/heads/main')
run: |
nix build .#dockerImage -o docker-image.tgz
echo "image_name=$(nix eval --raw .#dockerImage.imageName):$(nix eval --raw .#dockerImage.imageTag)" >> $GITHUB_OUTPUT
- name: Upload Docker image tarball
if: (github.ref == 'refs/heads/main')
uses: actions/upload-artifact@v4
with:
name: docker-image
Expand All @@ -49,7 +47,6 @@ jobs:
push-docker:
needs: build
runs-on: ubuntu-latest
if: (github.ref == 'refs/heads/main')
steps:
- name: Download Docker image tarball
uses: actions/download-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions crates/location_tracking_service/src/common/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ pub struct AuthData {
pub merchant_operating_city_id: MerchantOperatingCityId,
}

#[derive(Debug, Deserialize, Serialize)]
pub struct DriverLocationPoint {
pub driver_id: DriverId,
pub location: Point,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ async fn search_nearby_drivers_with_vehicle(
)
.await?;

info!("Drivers in nearby {:?}", nearby_drivers);

let driver_ids: Vec<DriverId> = nearby_drivers
.iter()
.map(|driver| driver.driver_id.to_owned())
Expand Down Expand Up @@ -75,6 +77,8 @@ async fn search_nearby_drivers_with_vehicle(
})
.collect::<Vec<DriverLocationDetail>>();

info!("Final resp {:?}", resp);

Ok(resp)
}

Expand All @@ -93,8 +97,18 @@ pub async fn get_nearby_drivers(

let current_bucket = get_bucket_from_timestamp(&data.bucket_size, TimeStamp(Utc::now()));

info!("Vehicle type before {:?}", vehicle_type);

let vehicle_type = match vehicle_type {
Some(ref vec) if vec.is_empty() => None,
_ => vehicle_type,
};

info!("Vehicle type after {:?}", vehicle_type);

match vehicle_type {
None => {
info!("Woohoo 3");
let mut resp: Vec<DriverLocationDetail> = Vec::new();

for vehicle in VehicleType::iter() {
Expand Down Expand Up @@ -122,6 +136,7 @@ pub async fn get_nearby_drivers(
Ok(resp)
}
Some(vehicles) => {
info!("Woohoo 1");
let mut resp: Vec<DriverLocationDetail> = Vec::new();
for vehicle in vehicles {
let nearby_drivers = search_nearby_drivers_with_vehicle(
Expand Down
2 changes: 2 additions & 0 deletions crates/location_tracking_service/src/redis/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ pub async fn get_drivers_within_radius(
.await
.map_err(|err| AppError::InternalError(err.to_string()))?;

info!("Get Nearby Drivers 1 {:?}", nearby_drivers);

let nearby_drivers: Vec<(DriverId, Point)> = cat_maybes(nearby_drivers)
.into_iter()
.map(|(driver_id, point)| {
Expand Down

0 comments on commit 7d9d180

Please sign in to comment.