Skip to content

Commit

Permalink
Avoid multiple queries to gitlab with no events (#357)
Browse files Browse the repository at this point in the history
GitLab plugin was accessing GitLab API multiple times if the events set
was empty. Now it accesses the API only once.

Signed-off-by: Sandro Bonazzola <[email protected]>
  • Loading branch information
sandrobonazzola authored Jun 28, 2024
1 parent 4d57c64 commit 017887f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion did/plugins/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def search(self, user, since, until, target_type, action_name):
""" Perform GitLab query """
if not self.user:
self.user = self.get_user(user)
if not self.events:
if self.events is None:
self.events = self.user_events(self.user['id'], since, until)
result = []
for event in self.events:
Expand Down

0 comments on commit 017887f

Please sign in to comment.