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/21 08:53:41 UTC

[kibble-scanners] 01/02: update source status

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

commit 266d0999696193c59c1b545e567028967cf83ba3
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sat Oct 21 10:53:16 2017 +0200

    update source status
---
 src/plugins/scanners/github-issues.py | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/plugins/scanners/github-issues.py b/src/plugins/scanners/github-issues.py
index 6710a8c..a481976 100644
--- a/src/plugins/scanners/github-issues.py
+++ b/src/plugins/scanners/github-issues.py
@@ -124,6 +124,13 @@ def scan(KibbleBit, source):
         if creds and 'username' in creds:
             auth = (creds['username'], creds['password'])
     print("Scanning for GitHub issues")
+    source['steps']['issues'] = {
+            'time': time.time(),
+            'status': 'Issue scan started at ' + time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()),
+            'running': True,
+            'good': True,
+        }
+    KibbleBit.updateSource(source)
     try:
         issues = plugins.utils.github.get_all(source, plugins.utils.github.issues,
                                    params={'filter': 'all', 'state':'all'},
@@ -154,8 +161,22 @@ def scan(KibbleBit, source):
                     continue
 
             update_issue(KibbleBit, doc)
+        
+        source['steps']['issues'] = {
+            'time': time.time(),
+            'status': 'Issue scan completed at ' + time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()),
+            'running': False,
+            'good': True,
+        }
+        KibbleBit.updateSource(source)
 
     except requests.HTTPError as e:
         # we've likely hit our GH API quota for the hour, so we re-try
         KibbleBit.pprint("HTTP Error, rate limit exceeded?")
-        time.sleep(3600)
+        source['steps']['issues'] = {
+            'time': time.time(),
+            'status': 'Issue scan failed at ' + time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime() + " - rate limited??"),
+            'running': False,
+            'good': False,
+        }
+        KibbleBit.updateSource(source)

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