Ejemplo n.º 1
0
 def txn():
   index = random.randint(0, NUM_SHARDS - 1)
   shard_name = "shard" + str(index)
   counter = PLSimpleCounterShard.get_by_key_name(shard_name)
   if counter is None:
     counter = PLSimpleCounterShard(key_name=shard_name)
   counter.count += value
   counter.put()