Ejemplo n.º 1
0
    def stats_record(self, duration):
        request = get_root_request()
        if request is None:
            return

        duration = int(duration * 1e6)
        stats = request._stats
        stats[self.stats_count_key] = stats.get(self.stats_count_key, 0) + 1
        stats[self.stats_time_key] = stats.get(self.stats_time_key, 0) + duration
Ejemplo n.º 2
0
    def stats_record(self, duration):
        request = get_root_request()
        if request is None:
            return

        duration = int(duration * 1e6)
        stats = request._stats
        stats[self.stats_count_key] = stats.get(self.stats_count_key, 0) + 1
        stats[self.stats_time_key] = stats.get(self.stats_time_key,
                                               0) + duration
Ejemplo n.º 3
0
 def invalidated(self):
     request = get_root_request()
     if request is None:
         return False
     edits = dict.get(request.session, 'edits', None)
     if edits is None:
         return False
     version = self.hit['_version']
     source = self.source
     linked_uuids = set(source['linked_uuids'])
     embedded_uuids = set(source['embedded_uuids'])
     for xid, updated, linked in edits:
         if xid < version:
             continue
         if not embedded_uuids.isdisjoint(updated):
             return True
         if not linked_uuids.isdisjoint(linked):
             return True
     return False
Ejemplo n.º 4
0
 def invalidated(self):
     request = get_root_request()
     if request is None:
         return False
     edits = dict.get(request.session, 'edits', None)
     if edits is None:
         return False
     version = self.hit['_version']
     source = self.source
     linked_uuids = set(source['linked_uuids'])
     embedded_uuids = set(source['embedded_uuids'])
     for xid, updated, linked in edits:
         if xid < version:
             continue
         if not embedded_uuids.isdisjoint(updated):
             return True
         if not linked_uuids.isdisjoint(linked):
             return True
     return False