4ddc017 Use a much less memory hungry lambda

Authored and Committed by Michael Scherer 3 years ago
    Use a much less memory hungry lambda
    
    Since [msg for msg in query.all() if msg.msg['new'] is 1] is
    constructing a gigantic list in memory with all decoded json
    message, we are hitting memory limit on a regular basis. I suspect
    something changed on fedmsg side recently that did start
    to make the msg take a lot more memory since fedbadge crash
    every 10 to 15 minutes each time a build is made.
    
    Increasing memory is not enough, since that consume more than 20G
    (I did test that). So the simplest solution is to not
    build a list to count the items, but just count them with sum.
    
    The same pattern should be applied to others rules.
    
        
file modified
+1 -1