You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2024/05/29 06:42:24 UTC

(incubator-devlake) 01/01: fix: github users org api may report 404

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch kw-github-userorgs-may-report-404
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit ec44d6a22f28bd1631885546612c39024c4d628c
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Wed May 29 14:42:04 2024 +0800

    fix: github users org api may report 404
---
 backend/plugins/github/tasks/account_org_collector.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/backend/plugins/github/tasks/account_org_collector.go b/backend/plugins/github/tasks/account_org_collector.go
index 5f9cf5a29..9127b60d7 100644
--- a/backend/plugins/github/tasks/account_org_collector.go
+++ b/backend/plugins/github/tasks/account_org_collector.go
@@ -98,6 +98,12 @@ func CollectAccountOrg(taskCtx plugin.SubTaskContext) errors.Error {
 			res.Body.Close()
 			return []json.RawMessage{body}, nil
 		},
+		AfterResponse: func(res *http.Response) errors.Error {
+			if res.StatusCode == http.StatusNotFound {
+				return api.ErrIgnoreAndContinue
+			}
+			return nil
+		},
 	})
 
 	if err != nil {