You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2017/10/23 18:42:52 UTC

[kibble-scanners] branch master updated: grab a lot of email, bail at 50 legit ones

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git


The following commit(s) were added to refs/heads/master by this push:
     new 9ad0e6c  grab a lot of email, bail at 50 legit ones
9ad0e6c is described below

commit 9ad0e6cac4c394d16304d29b1aa09a52da022507
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Oct 23 20:42:45 2017 +0200

    grab a lot of email, bail at 50 legit ones
---
 src/plugins/scanners/ponymail-tone.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/plugins/scanners/ponymail-tone.py b/src/plugins/scanners/ponymail-tone.py
index f83409c..919fc76 100644
--- a/src/plugins/scanners/ponymail-tone.py
+++ b/src/plugins/scanners/ponymail-tone.py
@@ -31,6 +31,7 @@ import plugins.utils.tone
 title = "Tone/Mood Scanner plugin for Apache Pony Mail"
 version = "0.1.0"
 ROBITS = r"(git|gerrit|jenkins|hudson|builds)@"
+MAX_COUNT = 50
 
 def accepts(source):
     """ Test if source matches a Pony Mail archive """
@@ -85,12 +86,15 @@ def scan(KibbleBit, source):
         index=KibbleBit.dbname,
         doc_type="email",
         body = query,
-        size = 50
+        size = 500
     )
-    
+    ec = 0
     for hit in res['hits']['hits']:
         eml = hit['_source']
         if 'mood' not in eml and not re.search(ROBITS, eml['sender']):
+            ec += 1
+            if ec > MAX_COUNT:
+                break
             emlurl = "%s/api/email.lua?id=%s" % (rootURL, eml['id'])
             KibbleBit.pprint("Fetching %s" % emlurl)
             rv = requests.get(emlurl).json()

-- 
To stop receiving notification emails like this one, please contact
['"commits@kibble.apache.org" <co...@kibble.apache.org>'].