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

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new caaa70b  remove code not ready for production
caaa70b is described below

commit caaa70b621f16ec2f93bbc23e61454ec7e838f2c
Author: Sam Ruby <[email protected]>
AuthorDate: Fri Dec 8 22:21:55 2017 -0500

    remove code not ready for production
---
 www/board/agenda/views/sw.js.rb | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/www/board/agenda/views/sw.js.rb b/www/board/agenda/views/sw.js.rb
index 4a277d7..3af0094 100644
--- a/www/board/agenda/views/sw.js.rb
+++ b/www/board/agenda/views/sw.js.rb
@@ -99,18 +99,6 @@ def fetch_from_cache(event)
   end
 end
 
-# fetch from network with timeout
-def fetch_from_network(event, timeout)
-  return Promise.new do |fulfill, reject|
-    timeout = setTimeout(reject, timeout)
-    fetch(event.request).then(lambda {|response|
-      clearTimeout(timeout)
-      cache_replace(cache, event.request, response.clone())
-      fulfill(response)
-    }, reject)
-  end
-end
-
 # Return a bootstrap.html page within 0.5 seconds.  If the network responds
 # in time, go with that response, otherwise respond with a cached version.
 def bootstrap(event, request)
@@ -194,15 +182,6 @@ self.addEventListener :fetch do |event|
     elsif url =~ %r{\.(js|css)\?\d+$}
       # cache and respond to js and css requests
       event.respondWith(fetch_from_cache(event))
-
-    elsif url == '/' or url == ''
-      console.log '=' + url.inspect
-      # respond from network, with 1 second timeout; else use cache
-      event.respondWith(fetch_from_network(event, 1_000).catch {
-        return fetch_from_cache(event)
-      })
-    else
-      console.log '?' + url.inspect
     end
   end
 end

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to