# What this PR does Adds endpoint for integration backsync Related to https://github.com/grafana/oncall-private/issues/2542 ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes.
14 lines
374 B
Python
14 lines
374 B
Python
from rest_framework.throttling import SimpleRateThrottle
|
|
|
|
|
|
class BacksyncRateThrottle(SimpleRateThrottle):
|
|
"""
|
|
Integration backsync rate limit
|
|
"""
|
|
|
|
scope = "backsync"
|
|
rate = "300/m"
|
|
|
|
def get_cache_key(self, request, view):
|
|
ident = request.auth.alert_receive_channel.pk
|
|
return self.cache_format % {"scope": self.scope, "ident": ident}
|