| OLD | NEW |
| 1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Grab bag file for transaction.""" | 5 """Grab bag file for transaction.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 | 8 |
| 9 from google.appengine.api import datastore_errors | 9 from google.appengine.api import datastore_errors |
| 10 from google.appengine.ext import ndb | 10 from google.appengine.ext import ndb |
| 11 from google.appengine.ext.ndb import tasklets | 11 from google.appengine.ext.ndb import tasklets |
| 12 from google.appengine.runtime import apiproxy_errors | 12 from google.appengine.runtime import apiproxy_errors |
| 13 | 13 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 """Decorator that wraps a function with txn.transaction.""" | 80 """Decorator that wraps a function with txn.transaction.""" |
| 81 return transactional_async.wrapped_decorator( | 81 return transactional_async.wrapped_decorator( |
| 82 func, args, kwds, **ctx_options).get_result() | 82 func, args, kwds, **ctx_options).get_result() |
| 83 | 83 |
| 84 | 84 |
| 85 @ndb.utils.decorator | 85 @ndb.utils.decorator |
| 86 def transactional_tasklet(func, args, kwds, **options): | 86 def transactional_tasklet(func, args, kwds, **options): |
| 87 """The tasklet version of @txn.transactional_async.""" | 87 """The tasklet version of @txn.transactional_async.""" |
| 88 func = tasklets.tasklet(func) | 88 func = tasklets.tasklet(func) |
| 89 return transactional_async.wrapped_decorator(func, args, kwds, **options) | 89 return transactional_async.wrapped_decorator(func, args, kwds, **options) |
| OLD | NEW |