[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] On first run of the UpdateInputsAndResources task fetch the resources with unknown country code



commit 52768c3eca7ebaa939af8f62c04a182e9de003dd
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date:   Tue Sep 20 21:21:18 2016 +0200

    On first run of the UpdateInputsAndResources task fetch the resources with unknown country code
    
    This fixes: https://github.com/TheTorProject/ooni-probe/issues/606
---
 ooni/agent/scheduler.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ooni/agent/scheduler.py b/ooni/agent/scheduler.py
index be141eb..cc71ee4 100644
--- a/ooni/agent/scheduler.py
+++ b/ooni/agent/scheduler.py
@@ -138,6 +138,14 @@ class UpdateInputsAndResources(ScheduledTask):
     schedule = "@daily"
 
     @defer.inlineCallbacks
+    def first_run(self):
+        """
+        On first run we update the resources that are common to every country.
+        """
+        log.debug("Updating the global inputs and resources")
+        yield resources.check_for_update("ZZ")
+
+    @defer.inlineCallbacks
     def task(self):
         log.debug("Updating the inputs")
         yield probe_ip.lookup()



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits