Exemple #1
0
  def work(self):
    hruntime.clean()
    hruntime.db.start_transaction()

    hruntime.dont_commit = True

    try:
      self.result = self.produce()
    except Exception, e:
      hruntime.dont_commit = True
      self.error = e
Exemple #2
0
  def test_clean(self):
    hruntime.user = True
    hruntime.dont_commit = True
    hruntime.ui_form = True
    hruntime.time = True

    hruntime.clean()

    NONE(hruntime.user)
    F(hruntime.dont_commit)
    NONE(hruntime.ui_form)
    ANY(hruntime.time)
Exemple #3
0
  def on_request_connected(self, _):
    hruntime.clean()
    hruntime.db.start_transaction()

    hruntime.dont_commit = True

    with STATS:
      STATS.inc(self.stats_name, 'Total requests')

    STATS.set(self.stats_name, 'Requests', hruntime.tid, OrderedDict([
      ('Bytes read',     0),
      ('Bytes written',  0),
      ('Client',         hlib.server.ips_to_str(hruntime.request.ips)),
      ('Start time',     hruntime.time),
      ('Requested line', None),
      ('User',           None)
    ]))