Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling for Geo background tasks #1513

Open
subinasr opened this issue Jul 15, 2024 · 0 comments
Open

Error handling for Geo background tasks #1513

subinasr opened this issue Jul 15, 2024 · 0 comments
Assignees

Comments

@subinasr
Copy link
Contributor

subinasr commented Jul 15, 2024

When geo background import tasks fail, the user doesn't get any feedback. We need to add a status field to fix this issue.

server/apps/geo/tasks.py

Lines 207 to 221 in 5f1d955

def load_geo_areas(region_id):
key = 'load_geo_areas_{}'.format(region_id)
lock = redis.get_lock(key, 60 * 30) # Lock lifetime 30 minutes
have_lock = lock.acquire(blocking=False)
if not have_lock:
return False
try:
return_value = _load_geo_areas(region_id)
except Exception:
logger.error('Load Geo Areas', exc_info=True)
return_value = False
lock.release()
return return_value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants