Skip to content

Commit

Permalink
[api] avoid crashing in package commit event with too many commited f…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
adrianschroeter committed Feb 24, 2015
1 parent 5612ecf commit 3a45e02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/api/app/models/event/package.rb
Expand Up @@ -63,6 +63,13 @@ class Commit < Package
def subject
"#{payload['project']}/#{payload['package']} r#{payload['rev']} commited"
end

def set_payload(attribs, keys)
# limit the error string
attribs['comment'] = attribs['comment'][0..800] unless attribs['comment'].blank?
attribs['files'] = attribs['files'][0..800] unless attribs['files'].blank?
super(attribs, keys)
end
end

class Upload < Package
Expand Down

0 comments on commit 3a45e02

Please sign in to comment.