Skip to content

Commit 9bccf4c

Browse files
committed
updates
1 parent 43fb4b7 commit 9bccf4c

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

core/api/bookings/events/artisan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ def update_location(uid, data):
150150
)
151151
g_hash = g_hash[0]
152152
# store the count in a g_hash
153-
geo_fence_key = g_hash[:6]
153+
geo_fence_key = g_hash[:5]
154+
print(geo_fence_key, "artisan loc ghash")
154155

155156
category = data['job_category']
156157
cat_hash_key = f'{category}+{geo_fence_key}'

tasks/booking_tasks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ def pbq(booking_details):
6060
# broadcast message to artisans using a redis pub/sub channel
6161
# the channel is unique to each artisan and its id is synonymous
6262
# to the artisan's geohash
63+
print(g_hash[0][:5], "customer loc ghash")
6364

64-
redis_2.publish(g_hash[0][:6], str(booking_details))
65+
# TODO: filter neighbouring points here to address boundary problem
66+
# and also properly cast to desired radius.
67+
68+
redis_2.publish(g_hash[0][:5], str(booking_details))
6569

6670

6771
@huey.task()

0 commit comments

Comments
 (0)