Skip to content

Commit

Permalink
Use random.random() instead of time.clock() for script updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ziransun authored and jdm committed Jul 8, 2020
1 parent af86bff commit dcc2ecf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions service-workers/service-worker/resources/mint-new-worker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import time

from six import PY3
import random

import time

body = u'''
onactivate = (e) => e.waitUntil(clients.claim());
Expand All @@ -25,4 +24,4 @@ def main(request, response):
if b'skip-waiting' in request.GET:
skipWaiting = u'skipWaiting();'

return headers, u'/* %s %s */ %s %s' % (time.time(), time.perf_counter() if PY3 else time.clock(), skipWaiting, body)
return headers, u'/* %s %s */ %s %s' % (time.time(), random.random(), skipWaiting, body)

0 comments on commit dcc2ecf

Please sign in to comment.