Skip to content

Commit

Permalink
Merge branch 'develop' into 'fb-dia-1783/tailwind-next'
Browse files Browse the repository at this point in the history
  • Loading branch information
bmartel committed Mar 6, 2025
2 parents 1f44b51 + 4108f9e commit 22506cd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
11 changes: 11 additions & 0 deletions label_studio/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,17 @@
FRONTEND_SENTRY_DSN = get_env('FRONTEND_SENTRY_DSN', None)
FRONTEND_SENTRY_RATE = get_env('FRONTEND_SENTRY_RATE', 0.01)
FRONTEND_SENTRY_ENVIRONMENT = get_env('FRONTEND_SENTRY_ENVIRONMENT', 'stage.opensource')
SENTRY_IGNORED_EXCEPTIONS = [
'Http404',
'NotAuthenticated',
'AuthenticationFailed',
'NotFound',
'XMLSyntaxError',
'FileUpload.DoesNotExist',
'Forbidden',
'KeyboardInterrupt',
'PermissionDenied',
]

ROOT_URLCONF = 'core.urls'
WSGI_APPLICATION = 'core.wsgi.application'
Expand Down
11 changes: 1 addition & 10 deletions label_studio/core/utils/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ def event_processor(event, hint):
# skip specified exceptions
exceptions = event.get('exception', {}).get('values', [{}])
last = exceptions[-1]
if last.get('type') in [
'Http404',
'NotAuthenticated',
'AuthenticationFailed',
'NotFound',
'XMLSyntaxError',
'FileUpload.DoesNotExist',
'Forbidden',
'KeyboardInterrupt',
]:
if last.get('type') in settings.SENTRY_IGNORED_EXCEPTIONS:
return None

# sentry ignored factory class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ def predictions_to_annotations(project, queryset, **kwargs):
)
# Update counters for tasks and is_labeled. It should be a single operation as counters affect bulk is_labeled update
project.update_tasks_counters_and_is_labeled(Task.objects.filter(id__in=tasks_ids))

try:
from stats.functions.stats import recalculate_stats_async_or_sync

recalculate_stats_async_or_sync(project, all=False)
except (ModuleNotFoundError, ImportError):
logger.info('Predictions converted to annotations in LSO, stats recomputation skipped')

return {'response_code': 200, 'detail': f'Created {count} annotations'}


Expand Down

0 comments on commit 22506cd

Please sign in to comment.