summaryrefslogtreecommitdiff
path: root/zuul/driver/github/githubconnection.py
diff options
context:
space:
mode:
Diffstat (limited to 'zuul/driver/github/githubconnection.py')
-rw-r--r--zuul/driver/github/githubconnection.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py
index 1957cc247..a7aefe0cd 100644
--- a/zuul/driver/github/githubconnection.py
+++ b/zuul/driver/github/githubconnection.py
@@ -646,9 +646,12 @@ class GithubConnection(BaseConnection):
return self._github
def maintainCache(self, relevant):
+ remove = set()
for key, change in self._change_cache.items():
if change not in relevant:
- del self._change_cache[key]
+ remove.add(key)
+ for key in remove:
+ del self._change_cache[key]
def getChange(self, event, refresh=False):
"""Get the change representing an event."""
@@ -661,7 +664,6 @@ class GithubConnection(BaseConnection):
change.uris = [
'%s/%s/pull/%s' % (self.server, project, change.number),
]
- change.updated_at = self._ghTimestampToDate(event.updated_at)
change.source_event = event
change.is_current_patchset = (change.pr.get('head').get('sha') ==
event.patch_number)
@@ -789,6 +791,8 @@ class GithubConnection(BaseConnection):
change.labels = change.pr.get('labels')
# ensure message is at least an empty string
change.message = change.pr.get('body') or ''
+ change.updated_at = self._ghTimestampToDate(
+ change.pr.get('updated_at'))
if history is None:
history = []