[tor-commits] [ooni-probe/master] Do not load all logs by default

art at torproject.org art at torproject.org
Fri Jan 13 12:39:58 UTC 2017


commit c8bca9b58fd0a83f5f1d40f43fd7f334288e35d9
Author: Arturo Filastò <arturo at filasto.net>
Date:   Wed Dec 7 12:18:44 2016 +0000

    Do not load all logs by default
---
 ooni/ui/web/server.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/ooni/ui/web/server.py b/ooni/ui/web/server.py
index 188612f..efcad14 100644
--- a/ooni/ui/web/server.py
+++ b/ooni/ui/web/server.py
@@ -617,11 +617,12 @@ class WebUIAPI(object):
             'latest': log_data,
             'older': []
         }
-        for log_filepath in glob(log.oonilogger.log_filepath + ".*"):
-            with open(log_filepath) as input_file:
-                log_data = input_file.read()
-            logs['older'].append(log_data)
-        logs['older'].reverse()
+        if request.args.get('all', False) is not False:
+            for log_filepath in glob(log.oonilogger.log_filepath + ".*"):
+                with open(log_filepath) as input_file:
+                    log_data = input_file.read()
+                logs['older'].append(log_data)
+            logs['older'].reverse()
         return self.render_json(logs, request)
 
     @app.route('/client/', branch=True)





More information about the tor-commits mailing list