From 247e1a865db29a3189acfd89cde776a52a7ebaac Mon Sep 17 00:00:00 2001 From: rng-dynamics <73444470+rng-dynamics@users.noreply.github.com> Date: Tue, 14 Sep 2021 22:22:28 +0200 Subject: feature: Github bridge mutation rate limit (#694) Unified handling of rate limiting of github graphql api --- bridge/core/export.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bridge/core') diff --git a/bridge/core/export.go b/bridge/core/export.go index fa531c5f..6e0612fa 100644 --- a/bridge/core/export.go +++ b/bridge/core/export.go @@ -31,6 +31,9 @@ const ( // but not severe enough to consider the export a failure. ExportEventWarning + // The export system (web API) has reached a rate limit + ExportEventRateLimiting + // Error happened during export ExportEventError ) @@ -74,6 +77,8 @@ func (er ExportResult) String() string { return fmt.Sprintf("warning at %s: %s", er.ID, er.Err.Error()) } return fmt.Sprintf("warning: %s", er.Err.Error()) + case ExportEventRateLimiting: + return fmt.Sprintf("rate limiting: %s", er.Reason) default: panic("unknown export result") @@ -145,3 +150,10 @@ func NewExportTitleEdition(id entity.Id) ExportResult { Event: ExportEventTitleEdition, } } + +func NewExportRateLimiting(msg string) ExportResult { + return ExportResult{ + Reason: msg, + Event: ExportEventRateLimiting, + } +} -- cgit