コード例 #1
0
ファイル: server.py プロジェクト: happz/hlib
  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
コード例 #2
0
ファイル: runtime.py プロジェクト: happz/hlib
  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)
コード例 #3
0
ファイル: engine.py プロジェクト: happz/hlib
  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)
    ]))