affected = group.messagefiltervalue_set.filter(key=key, value=value).update(times_seen=F('times_seen') + 1) if not affected: group.messagefiltervalue_set.create( key=key, value=value, times_seen=1, ) except Exception, exc: # TODO: should we mail admins when there are failures? try: logger.exception(u'Unable to process log entry: %s' % (exc,)) except Exception, exc: warnings.warn(u'Unable to process log entry: %s' % (exc,)) else: if mail and should_mail(group): regression_signal.send(sender=GroupedMessage, instance=group) group.mail_admins() return instance class GroupedMessageManager(SentryManager): def get_by_natural_key(self, logger, view, checksum): return self.get(logger=logger, view=view, checksum=checksum) def get_chart_data(self, group, max_days=90): if hasattr(group, '_state'): db = group._state.db else: db = 'default'
group.messagefiltervalue_set.create( key=key, value=value, times_seen=1, ) except Exception: return instance except Exception, exc: # TODO: should we mail admins when there are failures? try: logger.exception(u'Unable to process log entry: %s' % (exc,)) except Exception, exc: warnings.warn(u'Unable to process log entry: %s' % (exc,)) else: if mail and should_mail(group): regression_signal.send(sender=GroupedMessage, instance=group) group.mail_admins() return instance class GroupedMessageManager(SentryManager): def get_by_natural_key(self, logger, view, checksum): return self.get(logger=logger, view=view, checksum=checksum) def get_chart_data(self, group, max_days=90): if hasattr(group, '_state'): db = group._state.db else: db = 'default'
except Exception, exc: warnings.warn(u'Unable to process log entry: %s' % (exc,)) return event.group = group for view in views: group.views.add(view) # save the event unless its been sampled if not is_sample: event.save() # TODO: this should be moved into the processor framework if is_new and should_mail(group): regression_signal.send(sender=self.model, instance=group) group.mail_admins() return event def _create_group(self, event, **kwargs): from sentry.models import FilterValue, STATUS_RESOLVED date = event.datetime time_spent = event.time_spent project = event.project group, is_new = self.get_or_create( project=project, culprit=event.culprit,