diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-22 20:16:41 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-22 20:24:47 +0300 |
commit | 6f5ebc4bae8524585b5377d3056664730e0e1381 (patch) | |
tree | fc3ec67edee1fc6b885f86887e71486338c6969a /app/services/users | |
parent | 490cce630f5984d063283537ac42a6f9fbad86e6 (diff) |
Only cache the event for the fork-source when it exists
It is possible for a fork not to have a source anymore, in this case
we don't need to keep track of the push event.
Diffstat (limited to 'app/services/users')
-rw-r--r-- | app/services/users/last_push_event_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/users/last_push_event_service.rb b/app/services/users/last_push_event_service.rb index f2bfb60604f..57e446d7f30 100644 --- a/app/services/users/last_push_event_service.rb +++ b/app/services/users/last_push_event_service.rb @@ -16,8 +16,8 @@ module Users user_cache_key ] - if event.project.forked? - keys << project_cache_key(event.project.forked_from_project) + if forked_from = event.project.forked_from_project + keys << project_cache_key(forked_from) end keys.each { |key| set_key(key, event.id) } |