aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/core
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-04-10 09:50:51 +0200
committerGitHub <noreply@github.com>2021-04-10 09:50:51 +0200
commitd09b9d7c5a6cd8d201f2444ff1fb6302325e1651 (patch)
tree77c89ecb03b92e9cd016fc3b98f4d502374f5570 /bridge/core
parentbc5f618eba812859bf87ce2c31b278bd518d4555 (diff)
parent8fb6ea0d9578bc1cf94649091ddd03d038dddc47 (diff)
downloadgit-bug-d09b9d7c5a6cd8d201f2444ff1fb6302325e1651.tar.gz
Merge pull request #585 from MichaelMure/dev-gh-bridge
Deal with github bridge import rate limit
Diffstat (limited to 'bridge/core')
-rw-r--r--bridge/core/import.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/bridge/core/import.go b/bridge/core/import.go
index 0b0b4c68..c1965d4e 100644
--- a/bridge/core/import.go
+++ b/bridge/core/import.go
@@ -34,6 +34,9 @@ const (
// but not severe enough to consider the import a failure.
ImportEventWarning
+ // The import system (web API) has reached the rate limit
+ ImportEventRateLimiting
+
// Error happened during import
ImportEventError
)
@@ -87,6 +90,8 @@ func (er ImportResult) String() string {
parts = append(parts, fmt.Sprintf("err: %s", er.Err))
}
return strings.Join(parts, " ")
+ case ImportEventRateLimiting:
+ return fmt.Sprintf("rate limiting: %s", er.Reason)
default:
panic("unknown import result")
@@ -165,3 +170,10 @@ func NewImportIdentity(id entity.Id) ImportResult {
Event: ImportEventIdentity,
}
}
+
+func NewImportRateLimiting(msg string) ImportResult {
+ return ImportResult{
+ Reason: msg,
+ Event: ImportEventRateLimiting,
+ }
+}